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

Jim Diamond JimDiamond at ns.sympatico.ca
Thu Nov 21 17:20:23 CET 2019


On Sun, Nov 17, 2019 at 18:21 (+1300), Henri Menke wrote:

>>> 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.

> Actually right now the gray color model in plain TeX also converts to
> RGB, which I am now realizing, is very suboptimal, because it means that
> even though users may be using the gray colormodel, it is impossible to
> generate "true" monochrome documents.

It is hard to decide whether this is an argument for or against adding
the "defective" cmyk model \pgfutil at emu@cmyk to the plain TeX
definitions. :-)

Cheers.
                                Jim

> On 11/17/19 9:05 AM, Jim Diamond wrote:
>> 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