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"))
-- 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
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________