On Fri, Mar 15, 2024 at 09:44 (+0100), Hans Hagen wrote:
On 3/15/2024 12:53 AM, Jim wrote:
Max (et al),
were you hoping the ConTeXt distribution would ship its own pgfutil-context.def, or were you hoping that someone could convince Henri to put the RGB change in?
And, if anyone has the will to push this (or add it in to a ConTeXt distribution version), I'd still like the cmyk support, even if there is no ability to specify colour profiles:
\def\pgfutil@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 don't see that it would hurt anything, even if it doesn't give complete cmyk support.
We provide
\pgf@context@registercolor \pgf@context@registergray \pgf@context@registerrgb \pgf@context@registercmyk
in colo-ini that hook into the context color mechanism so be careful with patches. I'm not going to spend time on other solutions that can interfere with internals.
Thanks Hans, I was not familiar with those. The above code worked fine for me in plain TeX (the last time I used it, anyway). By the looks of things, Max has a vastly better idea of ConTeXt internals than I do, and if his proposed \pgfutil@emu@rgb doesn't break anything, it might give some confidence that the above \pgfutil@emu#cmyk won't either. (Yeah, I know, that is hardly a robust argument of anything.)
(I wonder when the moment comes that we have to take a snapshot of tikz and stay with that.)
I hope that time doesn't come, because either someone (you? :-) would be left with an on-going job of patching the snapshot, or ConTeXt's version of tikz would become increasingly different (and, presumably, increasingly less capable than the "mainline" version). Cheers. Jim