Am 05.08.2011 09:07, schrieb Procházka Lukáš Ing. - Pontex s. r. o.:
Hello,
I'd need to use the same color for text and drawing inside a MP code.
The typical situation looks the following way:
---- \definecolor[COL][.7red] \starttext \startMPcode label(btex \color[COL]{Some text} etex, (0, 0)); color col; col := .7red; draw unitsquare scaled .5cm withcolor col; \stopMPcode \stoptext ----
The problem is that the color must be defined twice - first as TeX's 'COL', later as MP's 'col'.
As far as I know, the 'COL' must be defined inside TeX code as colored text in MP is achieved *only* by calling TeX's "btex \a-color-family-command[a-color][some-text] etex".
So that's why I think the color must be defined in TeX.
But how to access the TeX's color in MP?
\MPcolor{tex color name} Best wishes, Peter
Thanks in advance.
Best regards,
Lukas