ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* color in hairlines
@ 2004-03-03  0:45 pawcoo
  2004-03-03 21:36 ` Hartmut Henkel
  0 siblings, 1 reply; 8+ messages in thread
From: pawcoo @ 2004-03-03  0:45 UTC (permalink / raw)


Hello All,

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?


Thanks, Pawe/l

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: color in hairlines
  2004-03-03  0:45 color in hairlines pawcoo
@ 2004-03-03 21:36 ` Hartmut Henkel
  2004-03-04 22:24   ` color in pdfTeX pawcoo
  0 siblings, 1 reply; 8+ messages in thread
From: Hartmut Henkel @ 2004-03-03 21:36 UTC (permalink / raw)


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}

Regards, Hartmut

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: color in pdfTeX
  2004-03-03 21:36 ` Hartmut Henkel
@ 2004-03-04 22:24   ` pawcoo
  2004-03-04 22:56     ` Hartmut Henkel
  2004-03-11  2:16     ` Guy Worthington
  0 siblings, 2 replies; 8+ messages in thread
From: pawcoo @ 2004-03-04 22:24 UTC (permalink / raw)


> 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: color in pdfTeX
  2004-03-04 22:24   ` color in pdfTeX pawcoo
@ 2004-03-04 22:56     ` Hartmut Henkel
  2004-03-05  7:21       ` pawcoo
  2004-03-11  2:16     ` Guy Worthington
  1 sibling, 1 reply; 8+ messages in thread
From: Hartmut Henkel @ 2004-03-04 22:56 UTC (permalink / raw)


On Thu, 4 Mar 2004, pawcoo wrote:

> > 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:

Note, forgot this: This only affects the \hrule and \vrule primitives.
When you do lines by literals, you are on your own...

> > \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

Seems to be currently the only way. The \pdfliteral{} primitives are
done between two x/y transformations, so you can't use q/Q grouping.
And the \pdfliteral direct{} variant doesn't help either, as it comes
before BT, but also _before_ ET, so grouping would be broken also.
Probably something to consider for a change...

Regards, Hartmut

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: color in pdfTeX
  2004-03-04 22:56     ` Hartmut Henkel
@ 2004-03-05  7:21       ` pawcoo
  2004-03-05 15:33         ` Henning Hraban Ramm
  0 siblings, 1 reply; 8+ messages in thread
From: pawcoo @ 2004-03-05  7:21 UTC (permalink / raw)



>>>\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
> 
> 
> Seems to be currently the only way. The \pdfliteral{} primitives are
> done between two x/y transformations, so you can't use q/Q grouping.
> And the \pdfliteral direct{} variant doesn't help either, as it comes
> before BT, but also _before_ ET, so grouping would be broken also.
> Probably something to consider for a change...
> 
> Regards, Hartmut

Ok. That doesn't hurt since I know, that there is no smarter way :-P
Thank You for help.

Pawe/l

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: color in pdfTeX
  2004-03-05  7:21       ` pawcoo
@ 2004-03-05 15:33         ` Henning Hraban Ramm
  2004-03-05 16:16           ` pawcoo
  0 siblings, 1 reply; 8+ messages in thread
From: Henning Hraban Ramm @ 2004-03-05 15:33 UTC (permalink / raw)



Am Freitag, 05.03.04, um 08:21 Uhr (Europe/Zurich) schrieb pawcoo:
>>> \pdfliteral{0 1 0 0 k}
>>>  colorized text
>>> \pdfliteral{0 0 0 1 k} % come back to black
>> Seems to be currently the only way. The \pdfliteral{} primitives are
>> done between two x/y transformations, so you can't use q/Q grouping.
>> And the \pdfliteral direct{} variant doesn't help either, as it comes
>> before BT, but also _before_ ET, so grouping would be broken also.
>> Probably something to consider for a change...
>> Regards, Hartmut
>
> Ok. That doesn't hurt since I know, that there is no smarter way :-P
> Thank You for help.

You really need plain pdfTeX, do you?
Otherwise you know ConTeXt's sophisticated color commands?


Grüßlis vom Hraban!
-- 
http://www.fiee.net/texnique/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: color in pdfTeX
  2004-03-05 15:33         ` Henning Hraban Ramm
@ 2004-03-05 16:16           ` pawcoo
  0 siblings, 0 replies; 8+ messages in thread
From: pawcoo @ 2004-03-05 16:16 UTC (permalink / raw)


Henning Hraban Ramm wrote:

> 
> You really need plain pdfTeX, do you?
> Otherwise you know ConTeXt's sophisticated color commands?

Actually I tried to retrive color tricks from ConTeXt core but without 
results.

Do I need plain pdfTeX? Good question! In general, I feel better when I 
understand every bit in the code (excluding binaries:). Typical control 
freak! Just for training, I often try to invent the wheel my self before 
I use it. Of course using ConTeXt and its sophisticated wheels is a 
great fun and user friendly way to do things, but the real pleasure is 
to know how the wheel works.

Regards, Pawe/l

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: color in pdfTeX
  2004-03-04 22:24   ` color in pdfTeX pawcoo
  2004-03-04 22:56     ` Hartmut Henkel
@ 2004-03-11  2:16     ` Guy Worthington
  1 sibling, 0 replies; 8+ messages in thread
From: Guy Worthington @ 2004-03-11  2:16 UTC (permalink / raw)


Pawe/l wrote

> 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)?

"miniltx" is a plain-tex inteface to the graphicx packages.   (If
you're using windows, it's bundled up in the look "plgraph" package.)

So if you install both the "graphicx" and the "plgraph" package, the
following plain-tex file should work:


%<--- %< --- %< --- %< --- %< --- %< --- %< --- %< --- %<
\input color
{\color{green}
  Text starts off in green
  \textcolor{red}{ a little red}
  returning to green
}
\bye
%<--- %< --- %< --- %< --- %< --- %< --- %< --- %< --- %<

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-03-11  2:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-03  0:45 color in hairlines pawcoo
2004-03-03 21:36 ` Hartmut Henkel
2004-03-04 22:24   ` color in pdfTeX pawcoo
2004-03-04 22:56     ` Hartmut Henkel
2004-03-05  7:21       ` pawcoo
2004-03-05 15:33         ` Henning Hraban Ramm
2004-03-05 16:16           ` pawcoo
2004-03-11  2:16     ` Guy Worthington

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).