[pgf-tikz] RGB colour model for plain TeX users

Jim zlists at ns.sympatico.ca
Fri Nov 8 20:35:25 CET 2019


Hi,

In Section 15.2 of the manual it says (under the "For plain TeX users"
paragraph)
        Only the two color models gray and rgb are supported.

In .../texmf-dist/tex/generic/pgf/utilities/pgfutil-plain.def it
defines the macros
        \pgfutil at emu@rgb#1#2,#3,#4\@nil
and
        \pgfutil at emu@gray#1#2,#3,#4\@nil

I have used the following to implement the RGB model:

\def\pgfutil at emu@RGB#1#2,#3,#4\@nil
{
    \pgfmathsetmacro{\@red@}{#2/255}%
    \pgfmathsetmacro{\@green@}{#3/255}%
    \pgfmathsetmacro{\@blue@}{#4/255}%
    \expandafter\edef\csname\string\color@#1\endcsname
        {\noexpand\xcolor@ {}{}{rgb}{\@red@,\@green@,\@blue@}}
}

and it works in all the cases I have tried.

Is there any chance of having this code (or better, but equivalent code)
added to pgfutil-plain.def, and the note in Section 15.2 of the manual
updated?

Thanks.

                                Jim


More information about the pgf-tikz mailing list