[pdftex] Color Package

Heiko Oberdiek oberdiek at uni-freiburg.de
Tue Mar 25 09:47:52 CET 2003


On Tue, Mar 25, 2003 at 04:57:14AM +0100, Reinhard Kotucha wrote:

> >>>>> "Arun" == Arun Kejariwal <arun_kejariwal at hotmail.com> writes:
> 
>     > Hi, Even when I include the color package
>     > (\usepackage[pdftex,usenames]{color}), pdflatex does not
>     > recognise colors like Violet, CadetBlue etc. Actually, I was
>     > trying to use Violet in the \hypersetup{ ...}. Whereas it works
>     > fine with latex. Could some one suggest me how to get around
>     > this?
> 
> If you want to use those colors in the text it is sufficient to put
> the line 
> 
> \input{dvipsnam.def}

Option "dvipsnames" loads dvipsnam.def.

> If you use it with \hypersetup it probably doesn't work.  I do not
> know which variable you want to set with \hypersetup, some of them
> require RGB colors rather than CMYK colors and the format might be
> different.

* Options that set color in TeX expect names:
    urlcolor, filecolor, linkcolor, ...
  More precise: the contents ("foo") of these options is used in
  the first argument of "\color{foo}".

* Options that set color in PDF dictionaries expect RGB values:
    urlbordercolor, menubordercolor, ...
  See PDF specification, key /C for annotations that want values
  in DeviceRGB color space.

Unhappily the color package misses an abstraction level:
The macro that stores the pieces of information for a color
name, model and parameters, does this in a low level and
therefore in a driver dependend manner:
  \\color at blue=macro:
  ->0 0 1 rg 0 0 1 RG
After loading of the color package it is a lot of work to
extract the data for use in the *bordercolor options.

A more generic interface would be given by the mappings:
* driver independent:
  *  <name> --> <model>
  *  <name>, <model> --> <value> [, <value>]*
  *  --> <defaultmodel>
* driver dependent:
  *  <name>, <model>, <value> [, <value>]* --> <internal representation>

Then color definitions in RGB can be provided and then easily
obtained by hyperref for use in *bordercolor options; but CMYK values
can used in the page description, if theses are preferred for printing
purposes.

Also color model conversions to RGB in a driver independent manner
could be given, if a color is not given in RGB.

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


More information about the pdftex mailing list