ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: \sometxt in staticMPfigure
Date: Tue, 26 Sep 2006 18:21:05 +0200	[thread overview]
Message-ID: <45195371.6020409@wxs.nl> (raw)
In-Reply-To: <E1GSFcY-00012D-00@skye.ra.phy.cam.ac.uk>

Sanjoy Mahajan wrote:
> Hans Hagen wrote:
>   
>> test case:
>>
>> \setupcolors[state=start,textcolor=red]
>> \starttext
>>     red
>>         \color[green]{green
>>             \startMPcode
>>                 label(\sometxt{green\color[blue]{blue}green}, origin) 
>> withcolor red;
>>                 draw fullcircle scaled 1cm xscaled 2;
>>             \stopMPcode
>>         green}
>>     red
>> \stoptext
>>     
>
> The test case works as you say (2006.09.26 beta).  Though I don't
> understand why [Note added later: I now understand, see at the
> end...]: e.g. why the 'green' text in the \sometxt is green.
> Shouldn't the withcolor red trump the \color[green] from ConTeXt?  I
> take your point about the lack of a color stack in metapost and the
> difficulty of getting the metapost and context stacks to interact.
>
> Here's a shorter example of what I'm confused about.
>
> \setupcolors[state=start,textcolor=yellow]
> \starttext
>             \startMPcode
>                 label(\sometxt{?red?}, origin) withcolor red;
>             \stopMPcode
> \stoptext
>
> The label(\sometxt{...}) withcolor red would produce postscript code like
>
>   1 0 0 setrgbcolor
>   <font stuff for ?red?>
>   0 0 0 setrgbcolor
>
> and that would be surrounded by code to set textcolor to yellow.
>
> Oh, I understand now.  The \sometxt{} wraps the ?red? in yellow
> setrgbcolor, since that's seen first by ConTeXt, and *then* it's
> wrapped by metapost in red setrgcolor, so the red is overridden by the
> yellow inside it.
>   
indeed, another option is to replace more of mp's color stuff by context but then we may end up in other problems 

Hans 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              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
-----------------------------------------------------------------

  reply	other threads:[~2006-09-26 16:21 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-25  3:51 Sanjoy Mahajan
2006-09-25 13:45 ` Hans Hagen
2006-09-25 20:39   ` Sanjoy Mahajan
2006-09-25 22:06     ` Hans Hagen
2006-09-25 23:04       ` Sanjoy Mahajan
2006-09-26 10:04         ` Hans Hagen
2006-09-26 12:11           ` Sanjoy Mahajan
2006-10-04 22:01           ` Aditya Mahajan
2006-10-05  8:00             ` Hans Hagen
2006-10-05 12:56               ` Sanjoy Mahajan
2006-09-26  0:53       ` Sanjoy Mahajan
2006-09-26  9:57         ` Hans Hagen
2006-09-26 12:02           ` Sanjoy Mahajan
2006-09-26 12:30             ` Hans Hagen
2006-09-26 13:33               ` Sanjoy Mahajan
2006-09-26 20:11                 ` Hans Hagen
2006-09-27  4:29                   ` Sanjoy Mahajan
2006-09-26 16:17           ` Sanjoy Mahajan
2006-09-26 16:21             ` Hans Hagen [this message]
2006-09-27  4:06               ` Sanjoy Mahajan
2006-09-27  8:03                 ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45195371.6020409@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).