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

Jim Diamond JimDiamond at ns.sympatico.ca
Sat Nov 16 21:05:52 CET 2019


Hi Phil,

On Sat, Nov 16, 2019 at 19:46 (+0000), Taylor, P wrote:

> Jim Diamond wrote:
>> [A] couple of minutes of playing
>> around gave me

>> \def\pgfutil at emu@cmyk#1#2,#3,#4,#5\@nil
>> {
>>      \pgfmathsetmacro{\@red@}{(1 - #2) * (1 - #5)}%
>>      \pgfmathsetmacro{\@green@}{(1 - #3) * (1 - #5)}%
>>      \pgfmathsetmacro{\@blue@}{(1 - #4) * (1 - #5)}%
>>      \expandafter\edef\csname\string\color@#1\endcsname
>>      {\noexpand\xcolor@ {}{}{rgb}{\@red@,\@green@,\@blue@}}
>> }

>> I realize that converting cmyk to rgb is a lot more contentious than
>> converting RGB to rgb,

> I think that it is more than "contentious"; I think that it is genuinely 
> dangerous.  I don't know whether PGF supports CMYK —

It does for pdflatex users.  If I ever find the time, I will try to
figure out what the difficulty for plain TeX is.  But I am not holding
my breath.

> if it does, then wonderful.  But if it does not, and if the addition
> of \pgfutil at emu@cmyk were to suggest that it does, then that could
> lead users to believe that they are generating CMYK graphics when
> they are in fact generating RGB.

This is true.  As mentioned earlier (not in your quote here) part of
the issue is whether it is better to give plain TeX users a
questionable approximation (so, at least, things look OK on their
screens) or to tell plain TeX users that they can't see TikZ/pgf
images that use cmyk at all.  Personally, I prefer the poor man's
approximation over nothing, but others may disagree (as, apparently,
Henri did).

On the other hand, if we added (for plain TeX users) a macro called
        \IAmOKWithAPoorApproximationOfCmyk
and the above \pgfutil at emu@cmyk macro was only defined after calling
        \IAmOKWithAPoorApproximationOfCmyk
then innocent plain TeX users wouldn't be fooled into thinking they
had real cmyk.

Cheers.
                                Jim


More information about the pgf-tikz mailing list