[pgf-tikz] what's the basic layer equivalent of \pgfsys at color@rgb

Tamas Papp tkpapp at gmail.com
Sun Dec 11 15:58:19 CET 2022


On v, dec 11 2022, Henri Menke via pgf-tikz wrote:

> On Sun, 2022-12-11 at 08:47 +0100, Tamas Papp wrote:
>> Hi,
>> 
>> If I have a color specified as RGB, with a floating point number for
>> each channel between 0 and 1, what's the exposed API to set this with
>> the basic layer? (as stroke, fill, or both).
>
> \definecolor{mycolor}{rgb}{<r>,<g>,<b>}
> \pgfsetcolor{mycolor}

Thanks for the quick response. Two questions:

1. So can I recycle mycolor multiple times, for time I need a color set?

2. Is there a difference between the above and

\pgfsetcolor{rgb,1:red,<r>;green,<g>;blue,<b>}

for speed, memory, or any other relevant aspect? I am wondering if the
above involves a division or not (by 1, but that is still a division).

best,

Tamas


More information about the pgf-tikz mailing list.