# Re: [NTG-context] ppchtex color

Alan BRASLAU wrote:

I would like to use color.

1. color= and rulecolor= does not appear to be implemented (mkiv)...
2. how can one change the color of the bonds?
3. using \color[red]{} causes the text to be offset.

"minimal" example:

\setupcolors[state=start]
\usemodule[chemic]
\starttext

\startchemical
\chemical[ONE,SB,Z0][C]
\stopchemical

\startchemical
\color[red]{\chemical[ONE,SB,Z0][C]}
\stopchemical
% text "C" is offset...

\startchemical
\chemical[ONE,SB,Z0][{\red C}]
\stopchemical
% OK, but I would like to draw the bonds as well in red.

\startchemical[color=red]
\chemical[ONE,SB,Z0][C]
\stopchemical
% "C" is red in mkii, black in mkiv

\startchemical[rulecolor=red]
\chemical[ONE,SB,Z0][C]
\stopchemical

setting happened at the outer level (ok, that's broken now but we can fix that later); so now, each formula must have the settings; when i have time i'll make a mkiv variant so that we can upgrade (i don't want interference with mkii since that version is also used in latex and we don't need to upgrade that)

\def\setchemicalattributes
{\scratchdimen\@@chemicalrulethickness
\def\chemicalattributes
{withpen pencircle scaled \the\scratchdimen\space
withcolor }%
\doifelsenothing\@@chemicalrulecolor
{\edef\chemicalattributes{\chemicalattributes black}}
{\edef\chemicalattributes{\chemicalattributes \MPcolor{\@@chemicalrulecolor}}}%
\startMPdrawing
drawoptions (\chemicalattributes) ;
\stopMPdrawing}

-----------------------------------------------------------------
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
| www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________