Hans van der Meer wrote:
I'm sorry, I ran it in a few variations, but neither does work here:
ah .. all those users who want to stress this tex-mp game to the limits ... keep in mind that tex in mp is actually a hack! your unknown will go away when you redefine the color commands to be unexpandable \unexpanded\def\startcolor {\ifincolor \expandafter\doglobalstartcolor \else \expandafter\noglobalstartcolor \fi} \unexpanded\def\stopcolor {\ifincolor \doglobalstopcolor \else \noglobalstopcolor \fi}
\setupcolors[state=start] \startMPenvironment % both with and without: [global] \setupcolors[state=start] \stopMPenvironment \setupMPpage[offset=2mm] \startuseMPgraphic{test} label(textext("\color[green]{XYZ}"), (0,0)); % returns black XYZ on execute label(textext("\startcolor[red]{XYZ}\stopcolor"), (0,20)); % returns "unknown" on execute \stopuseMPgraphic \starttext \forceMPTEXgraphictrue \startMPpage \includeMPgraphic{test} \stopMPpage \stoptext
I tried to run this on context-live but there got both outputs to "unknown".
color itself ... mp only reads back the character (+ some rule) data, nothing else, so color needs to be applied at another level (there is some limited and therefore useless special support) so, the best i can give you is: % output=pdf \unexpanded\def\startcolor {\ifincolor \expandafter\doglobalstartcolor \else \expandafter\noglobalstartcolor \fi} \unexpanded\def\stopcolor {\ifincolor \doglobalstopcolor \else \noglobalstopcolor \fi} \setupcolors[state=start] \startMPenvironment % both with and without: [global] % only font and macro defs make sense here \stopMPenvironment \setupMPpage[offset=2mm] \startuseMPgraphic{test} draw thelabel(textext("XYZ"), (0,0)) withcolor \MPcolor{green} ; draw thelabel(textext("XYZ"), (0,20)) withcolor \MPcolor{red} ; \stopuseMPgraphic \starttext \forceMPTEXgraphictrue \startMPpage \includeMPgraphic{test} \stopMPpage \stoptext