Add support for RGB color model in ConTeXt#1130
Conversation
|
Just for the info, the support for RGB in Plain TeX is addressed in #772. |
|
Looking around in the code the entire ConTeXt pgfutil could do with some refactoring. For example the gray colormodel just maps to rgb. |
d6fb8fb to
e48ff0f
Compare
|
I've also changed it so that the Manually creating a grayscale color now works, but the named gray colors still map to \usemodule[t][tikz]
\unprotect
\pgfutil@definecolor{test}{gray}{0.5}
\protect
\startTEXpage
\tikz\draw [test] (0, 0 ) -- (36bp, 0 );
\tikz\draw [gray] (0, 36bp) -- (36bp, 36bp);
\stopTEXpageproduces this PDF: |
e48ff0f to
df785fe
Compare
|
I redid the commit to (hopefully) make the "check-commits" CI pass. There weren't any code changes. |
|
I'd like to have a few ConTeXt tests before merging this so it is essentially also blocked by #1116 (or rather an extension thereof). |
The `RGB` support was copied from the the Plain TeX definitions, `tex/generic/pgf/utilities/pgfutil-plain.def:29-37`, which is from pgf-tikz#772. The `gray` color model now maps to the grayscale and not to `rgb`. Signed-off-by: Max Chernoff <49086429+gucci-on-fleek@users.noreply.github.com>
|
Would it be possible to get this PR merged? I've rebased it so it should apply cleanly. I know that the test suite hasn't been finished yet, but I've been applying this patch to my local installation for a two years now without any issues, so this shouldn't cause any regressions. Plus, this change only affects ConTeXt, so the impact of any possible bugs should be minimal. |
Motivation for this change
According to the manual, the
RGBcolor model should be supported in ConTeXt.pgf/doc/generic/pgf/pgfmanual-en-tikz-actions.tex
Lines 129 to 134 in 2131043
However, using
\pgfutil@definecolor{some-color}{RGB}{127,127,127}produces an error. A few of the pgfplots libraries use theRGBcolor model, so they cannot currently be used with ConTeXt.Modifications
Plain TeX supports the
RGBcolor model by internally converting torgb.pgf/tex/generic/pgf/utilities/pgfutil-plain.def
Lines 29 to 37 in 4cba1da
This PR just copies that same code over to
pgfutil-context.def.Checklist