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.

Cheers.
                                Jim

On Thu, Mar 14, 2024 at 17:18 (-0600), Max Chernoff wrote:

> Hi all,

> I've had a few patches applied to my installation for a little while
> now, so I figured that I should send them in. There's a diff at the end
> of the email, and the modified files are attached [but rejected by the
> mailing list, so sent separately to Hans]

>  * In the definition of "featurecreep()" in "lpdf-mis.lmt",
>    "structures.pages.tobesaved[i].status" should be "[...].state" to
> match the definition of "pages.save" in "strc-pag.lua". 

>  * For the "resultof" runner in "util-sbx.lmt", the current io.popen
> mode only works with Windows. See the definition of "l_checkmodep" in
>    "liolib.c".

>  * Some of the pgfplots 3D shaders appear to be broken,
> see https://tex.stackexchange.com/a/708121 .

>  * The TikZ "RGB" colour model does not currently work properly. This is
> internally used by "\usepgfplotslibrary[colorbrewer]" among others.
> See https://github.com/pgf-tikz/pgf/pull/1130 .

> Thanks,
> -- Max


> diff --git a/tex/generic/pgf/utilities/pgfutil-context.def 
> b/tex/generic/pgf/utilities/pgfutil-context.def
> index eddab09ab..66edb0980 100644
> --- a/tex/generic/pgf/utilities/pgfutil-context.def
> +++ b/tex/generic/pgf/utilities/pgfutil-context.def
> @@ -26,8 +26,17 @@
>  \def\pgfutil@definecolor#1#2#3{\csname pgfutil@emu@#2\endcsname{#1}#3\@nil}

>  
> \def\pgfutil@emu@rgb#1#2,#3,#4\@nil{\expandafter\def\csname\string\color@#1\endcsname{\xcolor@{}{}{rgb}{#2,#3,#4}}}
> -\def\pgfutil@emu@gray#1#2\@nil{\expandafter\def\csname\string\color@#1\endcsname{\xcolor@{}{}{rgb}{#2,#2,#2}}}
> +\def\pgfutil@emu@gray#1#2\@nil{\expandafter\def\csname\string\color@#1\endcsname{\xcolor@{}{}{gray}{#2}}}
>  
> \def\pgfutil@emu@cmyk#1#2,#3,#4,#5\@nil{\expandafter\def\csname\string\color@#1\endcsname{\xcolor@{}{}{cmyk}{#2,#3,#4,#5}}}
> +\def\pgfutil@emu@RGB#1#2,#3,#4\@nil{%
> +    \begingroup
> +    \pgfmathdivide@{#2}{255}\let\pgfutil@emu@RGB@r\pgfmathresult
> +    \pgfmathdivide@{#3}{255}\let\pgfutil@emu@RGB@g\pgfmathresult
> +    \pgfmathdivide@{#4}{255}\let\pgfutil@emu@RGB@b\pgfmathresult
> +    
> \edef\pgf@marshal{\def\expandafter\noexpand\csname\string\color@#1\endcsname{%
> +        
> \noexpand\xcolor@{}{}{rgb}{\pgfutil@emu@RGB@r,\pgfutil@emu@RGB@g,\pgfutil@emu@RGB@b}}}%
> +    \expandafter\endgroup\pgf@marshal
> +}


>  % no need for x colors (users can load it if needed)
> diff --git a/tex/generic/pgfplots/pgfplotsmeshplothandler.code.tex 
> b/tex/generic/pgfplots/pgfplotsmeshplothandler.code.tex
> index 60d6274..106c490 100644
> --- a/tex/generic/pgfplots/pgfplotsmeshplothandler.code.tex
> +++ b/tex/generic/pgfplots/pgfplotsmeshplothandler.code.tex
> @@ -2804,6 +2804,9 @@
>  \def\pgfplotsretval{4}%
>  \fi
>  \fi
> + \if0\pgfplotsretval
> + \def\pgfplotsretval{5}
> + \fi
>  \pgfkeyslet{/pgfplots/surf shading/shading type}\pgfplotsretval%
>  %
>  \pgfplotsplothandlermesh@set@shader@colormap
> diff --git 
> a/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-luatex.def 
> b/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-luatex.def
> index 0046daa..b563732 100644
> --- 
> a/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-luatex.def
> +++ 
> b/tex/generic/pgfplots/sys/pgflibrarypgfplots.surfshading.pgfsys-luatex.def
> @@ -61,7 +61,7 @@
>  \pgfplotslibrarysurfusepath
>  \endpgfpicture
>  }%
> - \immediate\saveboxresource resources{
> + \saveboxresource resources{
>  /Pattern << \pgfplots@glob@TMPa >> % write the pattern resource dictionary
>  }\pgfutil@tempboxa
>  \leavevmode
> diff --git a/tex/context/base/mkxl/util-sbx.lmt 
> b/tex/context/base/mkxl/util-sbx.lmt
> index b48d4a9..0ee8a16 100644
> --- a/tex/context/base/mkxl/util-sbx.lmt
> +++ b/tex/context/base/mkxl/util-sbx.lmt
> @@ -393,7 +393,7 @@ local runners = {
> if trace then
> report("resultof: %s",command)
> end
> -            local handle = iopopen(command,"rb") -- already has flush
> +            local handle = iopopen(command,"r") -- already has flush
> if handle then
> local result = handle:read("*all") or ""
> handle:close()
> diff --git a/tex/context/base/mkxl/lpdf-mis.lmt 
> b/tex/context/base/mkxl/lpdf-mis.lmt
> index 0f21cf9..a9cfe02 100644
> --- a/tex/context/base/mkxl/lpdf-mis.lmt
> +++ b/tex/context/base/mkxl/lpdf-mis.lmt
> @@ -510,7 +510,7 @@ local function featurecreep()
> return -- fatal error
> end
> local label = p.viewerprefix or ""
> -        if p.status == v_stop then
> +        if p.state == v_stop then
> if not stopped then
> list[#list+1] = i - 1 -- pdf starts numbering at 0
> list[#list+1] = pdfdictionary {


> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the 
> Wiki!

> maillist : ntg-context@ntg.nl / 
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive  : https://github.com/contextgarden/context
> wiki     : https://wiki.contextgarden.net
> ___________________________________________________________________________________
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to