[NTG-context] color in pdfTeX

pawcoo ntg-context@ntg.nl
Thu, 04 Mar 2004 23:24:34 +0100


> On Wed, 3 Mar 2004, pawcoo wrote:
> 
> 
>>please, consider the following simple example of pdftex code:
>>
>>\pdfliteral{0 1 0 0 k} % Magenta (ugly)
>>\hrule height 1pt
>>\hrule height 1.1pt
>>\end
>>
>>The upper hairline remains black. What should I do to colorize thin
>>lines also?
> 
> 
> Lines with width <= 1 bp are stroked by pdftex, lines wider than that
> are filled (procedure pdf_set_rule). Stroking CMYK color is set by K,
> nonstroking by k, so you need both:
> 
> \pdfliteral{0 1 0 0 k}
> \pdfliteral{0 1 0 0 K}

Thanks! That works. I'll dare to ask one more question. How to use 
colors in (some kind of) groups, meaning localy? In example, how to set 
some nice color for given object only (word, letter or rule)? Or should 
I always say something like

\pdfliteral{0 1 0 0 k}
  colorized text
\pdfliteral{0 0 0 1 k} % come back to black

Any clues?


Regards, Pawe/l