[pdftex] Color stack, first try

Heiko Oberdiek oberdiek at uni-freiburg.de
Mon Feb 17 16:09:26 CET 2003


On Mon, Feb 17, 2003 at 02:35:24PM +0100, Hans Hagen wrote:

> At 01:10 PM 2/17/2003 +0100, Heiko Oberdiek wrote:
> 
> >You mean something like the following?
> >
> >\special{color push Black}
> >\special{color pop}
> >\special{color push rgb 1 0 0}
> >\special{color push gray 1}
> >
> >And pdfTeX translates the arguments to
> >  Black        ==> 0 g 0 G
> >  rgb %1 %2 %3 ==> %1 %2 %3 rg %1 %2 %3 RG
> >  gray %1      ==> %1 g %1 G
> 
> indeed (and forget about the Black, no reason to stack names), if i'm right 
> this conforms to existing methods

dvips knows three methods for color specification:

* PostScript procedure, example:
  userdict begin /Goldenrod {0 .10 .75 .03 cmykcolor} bind def
  Other examples, see color.pro.
  And then this is used in:
  \special{color push Goldenrod}
  ==> The full power of PostScript procedures cannot be supported
      in pdfTeX because of missing PostScript interpreter.
  ==> Names, the common dvips case, could be used, but this would
      require a mechanism to map these to low level color
      specification.
      Thus I agree it is easier to forget names.
* The second method is a color model with parameters, see above.
* The third method is a PostScript sequence, not suitable for pdfTeX.

Color \special types of dvips:
* \special{color <colorspec>} would map to "colorset" in my suggestion.
* \special{color push <colorspec>} ==> "colorpush"
* \special{color pop} ==> "colorpop"
* \special{background <colorspec>}
  Currently implemeted by pdftex.def via redefining \shipout.
  A more robust solution by providing it in pdfTeX would be
  desired, but I see currently no urgency for this.

Yours sincerely
  Heiko <oberdiek at uni-freiburg.de>


More information about the pdftex mailing list