Am 03.09.2012 20:36, schrieb Hans Hagen:
On 3-9-2012 18:59, Peter Rolf wrote:
Hi,
for a batch command (ImageMagick) I need to convert ConTeXt colors to a text representation (e.g. rgb 'red' -> 'rgb(255,0,0)'; same for color models cmyk and gray). What is the best way to get (read only) access to the color channels of a defined color?
\colorcomponents{red} \colorvalue{red}
in next beta:
\startluacode
-- inspect(attributes.colors.spec("red"))
Thanks Hans, very nice. Looking out for the next beta. I'll use the time to check some other problems :-)
-- table={ -- ["b"]=0, -- ["c"]=0, -- ["model"]="cmyk", -- ["g"]=0, -- ["k"]=0, -- ["m"]=1, -- ["r"]=1, -- ["s"]=0.3, -- ["y"]=1, -- }
\stopluacode
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------