      SUBROUTINE METTABLE(ITABLE,N)
      INCLUDE 'Parametres.f'
C
      INTEGER ITABLE(*)
      DIMENSION RR(0:255),VV(0:255),BB(0:255)
C
      NN = IABS(N)
C      DO I=1,N
C        IF (ITABLE(NN).NE.ITABLE(1)) GOTO 100
C        NN = NN-1
C      ENDDO
C 100  NBCOULEURS = NN-16
      IF (IPOSTSCRIPT.EQ.1.OR.IPOSTSCRIPT.EQ.-2
     &.OR.IPOSTSCRIPT.EQ.-1) THEN
        NV  = 256
        NR  = 2**16
        DO I=1,NN
          ITR  = ITABLE(I)/NR
          ITVB = ITABLE(I)-ITR*NR
          ITV  = ITVB/NV
          ITB  = MOD(ITVB,NV)
          TABLE_ROUGE(I-1) = REAL(ITR)/255.
          TABLE_VERT(I-1)  = REAL(ITV)/255.
          TABLE_BLEU(I-1)  = REAL(ITB)/255.
        ENDDO
        IF (N.LE.0) THEN
          IDEBTABLE  = 0
          NNCOUL = NN+16
        ELSE
          IF (N.GT.200) THEN
            IDEBTABLE = 0
          ELSE
            IDEBTABLE = 200-N
          ENDIF
          NNCOUL = 255
        ENDIF
        II = IDEBTABLE+16
        IF (IPOSTSCRIPT.GE.0)
     &  CALL x11changecolormap
     &(TABLE_ROUGE,TABLE_VERT,TABLE_BLEU,RR,VV,BB,II,NNCOUL,IRC)
        TABLE_ROUGE(7) = 0.
        TABLE_VERT(7)  = 0.
        TABLE_BLEU(7)  = 0.
CC      print*,'La table de couleurs a ete bien mise'
      ENDIF
      END
