* pgf colors
@ 2011-08-19 8:32 Mojca Miklavec
0 siblings, 0 replies; only message in thread
From: Mojca Miklavec @ 2011-08-19 8:32 UTC (permalink / raw)
To: mailing list for ConTeXt users
Hello,
I'm asking just in case that there is any PGF guru on this mailing
list, else I will ask on the PGF list.
I have noticed that TikZ terminal for gnuplot is broken (it worked
half a year ago) because of the following definitions:
\def\gpcolor#1{\tikzset{global #1}}
\tikzset{rgb color/.code={\pgfutil@definecolor{.}{rgb}{#1}\color{.}}}
\tikzset{global rgb color/.code={\pgfutil@definecolor{.}{rgb}{#1}\color{.}}}
\tikzset{global color/.code={\color{#1}}}
Example of usage:
\gpcolor{color=gp lt color 0}
\gpcolor{rgb color={1.000,0.000,0.000}}
Clearly the command \color{...} is something latex-specific. The
question is - does anyone know how to rewrite the commands written
above into generic code that will work in all of the three: plain TeX,
LaTeX and ConTeXt?
"Minimal" example:
\usemodule[tikz]
\edef\tikzatcode{\the\catcode`\@}
\catcode`\@=11
\def\gpcolor#1{\tikzset{global #1}}
\tikzset{rgb color/.code={\pgfutil@definecolor{.}{rgb}{#1}\color{.}}}
\tikzset{global rgb color/.code={\pgfutil@definecolor{.}{rgb}{#1}\color{.}}}
\tikzset{global color/.code={\color{#1}}}
\catcode`\@=\tikzatcode
\starttext
\starttikzpicture
\gpcolor{color=red}
% or: \gpcolor{rgb color={1.000,0.000,0.000}}
\draw (0,0)--(10,0)--(10,5)--(0,5)--cycle; % this one should be red
\stoptikzpicture
\stoptext
Thanks,
Mojca
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-08-19 8:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-19 8:32 pgf colors Mojca Miklavec
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).