ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Sharing color between MP and TeX
@ 2011-08-05  7:07 Procházka Lukáš Ing. - Pontex s. r. o.
  2011-08-05  7:36 ` Peter Rolf
  2011-08-05  7:38 ` Hans Hagen
  0 siblings, 2 replies; 3+ messages in thread
From: Procházka Lukáš Ing. - Pontex s. r. o. @ 2011-08-05  7:07 UTC (permalink / raw)
  To: ConTeXt

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?

Thanks in advance.

Best regards,

Lukas


-- 
Ing. Lukáš Procházka [mailto:LPr@pontex.cz]
Pontex s. r. o.      [mailto:pontex@pontex.cz] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

Tel: +420 244 062 238
Fax: +420 244 461 038

___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-08-05  7:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-05  7:07 Sharing color between MP and TeX Procházka Lukáš Ing. - Pontex s. r. o.
2011-08-05  7:36 ` Peter Rolf
2011-08-05  7:38 ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).