1      SUBROUTINE GSPAT(I0)
2      INCLUDE 'Parametres.f'
3c
4      i = iabs(i0)
5      if (ipostscript.eq.1) then
6        if (i.eq.16) then
7          ii = icoulfond
8        else
9          ii = i
10        endif
11        icoulfond = ii
12      elseif(ipostscript.eq.-1) then
13CCC?        if (i.le.16.or.nbcouleurs.le.1) then
14        if (i.le.16) then
15          ggg = min(1.,max(0.,real(i)/16.))
16          if (i0.lt.0.and.ggg.gt..99) ggg = 0.
17        else
18C_NTSC          ggg = (table_rouge(i)+table_vert(i)+table_bleu(i))/3.
19          ggg = 0.3*table_rouge(i)
20     &        + 0.59*table_vert(i)
21     &        + 0.11*table_bleu(i)
22        endif
23        call ecriscouleur(ggg,gris_fond,lgris_fond)
24      else
25        if (i.eq.16) then
26          c1 = colfond(1)
27          c2 = colfond(2)
28          c3 = colfond(3)
29        else
30          c1 = table_rouge(i)
31          c2 = table_vert (i)
32          c3 = table_bleu (i)
33        endif
34        call ecriscouleur(c1,couleur_fond,l1)
35        couleur_fond(l1+1:l1+1) = ' '
36        call ecriscouleur(c2,couleur_fond(l1+2:),l2)
37        couleur_fond(l1+l2+2:l1+l2+2) = ' '
38        call ecriscouleur(c3,couleur_fond(l1+l2+3:),l3)
39        lcouleur_fond = l1+l2+l3+2
40      endif
41      end
42