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
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
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
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
\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
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/
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
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 %<--- %< --- %< --- %< --- %< --- %< --- %< --- %< --- %<
participants (4)
-
Guy Worthington
-
Hartmut Henkel
-
Henning Hraban Ramm
-
pawcoo