ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Mojca Miklavec <mojca.miklavec.lists@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Metafun textext()
Date: Thu, 10 Jan 2013 14:17:53 +0100	[thread overview]
Message-ID: <CALBOmsYRs=ax9ExmGLbrN0-8n0DnzurHdf9W=Hdz=dv+CHq=fA@mail.gmail.com> (raw)
In-Reply-To: <20130110140114.52c0a9be@sole>

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


  reply	other threads:[~2013-01-10 13:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-10 11:48 Alan BRASLAU
2013-01-10 11:51 ` Aditya Mahajan
2013-01-10 13:01   ` Alan BRASLAU
2013-01-10 13:17     ` Mojca Miklavec [this message]
2013-01-10 13:18     ` Aditya Mahajan
2013-01-11  0:01       ` Hans Hagen
2013-01-10 13:29     ` Alan BRASLAU

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='CALBOmsYRs=ax9ExmGLbrN0-8n0DnzurHdf9W=Hdz=dv+CHq=fA@mail.gmail.com' \
    --to=mojca.miklavec.lists@gmail.com \
    --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).