      SUBROUTINE PAWLEVMAT (IHIST,NCOL)

* Change materials colors
      PARAMETER (MAXRGN=1000)
      INTEGER ICOL(MAXRGN)
      DATA ICOL / MAXRGN*0 /

      REAL H(500000)
      CHARACTER*80 CHTITL

      LASTCOL = 2
      ICOL(1)=NCOL+1
      ICOL(2)=1

      CALL HGIVE(IHIST,CHTITL,NX,XMIN,XMAX,NY,YMIN,YMAX,NWT,LOC)
      CALL HUNPAK(IHIST,H,'HIST',0)

      DO I=1,NX*NY
           IC = INT(H(I))
           IF (ICOL(IC).EQ.0) THEN
               LASTCOL = LASTCOL+1
               IF (LASTCOL.EQ.NCOL) LASTCOL = 3
               ICOL(IC) = LASTCOL
           ENDIF
           H(I) = REAL(ICOL(IC))
      ENDDO
      CALL HPAK(IHIST,H)
*
      RETURN
      END

