On Thu, Jan 10, 2013 at 2:01 PM, Alan BRASLAU wrote:
On Thu, 10 Jan 2013 06:51:50 -0500 Aditya Mahajan wrote:
Since the beginning of MkIV, colors in metapost labels need to be set at the ConTeXt end (Untested):
T := thelabel(textext("\color[blue]{I'm seeing double}"), origin);
Aditya
I don't believe that this is true, but I am most likely wrong.
Based on a snippet from mp-gnuplot (and agreeing with your point of view that it would be nice if it worked without the extra hassle) I tend to agree with Aditya (and I seem to remember that Hans implemented \colored[r=...,g=...,b=...] command exactly when this became a problem): % Returns an image with colored text according to current color % This only makes sense for mkiv text. Mkii is handled with \sometxt % and colors are working properly there. /.../ vardef gp_colored_mkiv_text(expr str) = % since withcolor doesn't work any more, we need to provide a workaround. save r, g, b; r = redpart gp_color_current; g = greenpart gp_color_current; b = bluepart gp_color_current; rawtextext("\colored[r=" & decimal(r) & ",g=" & decimal(g) & ",b=" & decimal(b) & "]{" & str & "}") enddef; Mojca