From: Mojca Miklavec <mojca.miklavec.lists@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: pgf colors
Date: Fri, 19 Aug 2011 10:32:29 +0200 [thread overview]
Message-ID: <CALBOmsZRTB6sMVTtsw39uhvAhZNWL6xx-+4CgYqb2u6qfUrsPw@mail.gmail.com> (raw)
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
___________________________________________________________________________________
reply other threads:[~2011-08-19 8:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CALBOmsZRTB6sMVTtsw39uhvAhZNWL6xx-+4CgYqb2u6qfUrsPw@mail.gmail.com \
--to=mojca.miklavec.lists@gmail.com \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).