ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Rudd, Kevin" <kevin@lps.umd.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: "Rudd, Kevin" <kevin@lps.umd.edu>
Subject: Re: another MetaPost question (this time on ConTeXt->MetaPost color transfer)
Date: Thu, 22 Jul 2021 14:13:22 +0000	[thread overview]
Message-ID: <5ACE1373-F089-4A4F-B76D-4A810043012F@lps.umd.edu> (raw)
In-Reply-To: <1DE2F1FD-DB29-4E1D-955E-2E0E89DCFB9B@lps.umd.edu>


[-- Attachment #1.1: Type: text/plain, Size: 2682 bytes --]

... fixed minor typo that actually produced new information! invalid color => black, valid color => transparent black!---it seems like the color disappears in the transfer but not the transparency.

Hey---

There seems to be a change with color transfer from ConTeXt to MetaPost. Using string references to defined (spot?) colors seemed to work but now does not; all of my colorful figures are now rendered only in shades of gray when using defined (spot?) colors….

The figure drawn by the MWE should have a dark orange border and a transparent (thin) orange fill. However, all colors of this sort seem to end up being a single shade of gray (e.g. black), rendering a box perfect for Halloween use but not for my current purposes. Is there a change to how colors defined in ConTeXt are referenced in MetaPost that I've missed or is there an issue with transferring color (name or parameter) information to MetaPost? Defined (spot?) colors work fine in ConTeXt but not in MetaPost.

Many thanks,
 ---K

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% system          > ConTeXt  ver: 2021.07.21 19:54 LMTX  fmt: 2021.7.22  int: english/english

\startMPdefinitions

    presetparameters "parameters_Test"
    [
    ]

    def Test =
        applyparameters "parameters_Test" "do_Test"
    enddef;

    def do_Test =
        pushparameters "parameters_Test";

        string p;  p = getparameter "prefix";  show p;
        string c;  c = getparameter "color";   show c;
        path   s;  s = unitsquare scaled 10cm; show s;
        path   t;  t = unitsquare scaled  5cm; show t;              % new

        fill s                               withcolor p&":"&c;     % tweaked
        fill t                               withcolor p    &c;     % new (and old)
        draw s  withpen pencircle scaled 5pt withcolor       c;
    enddef;

\stopMPdefinitions

\starttext

\definespotcolor[Thin:orange][orange][p=1,a=normal,t=0.5]

\color[orange]{hello}

\startalignment[center]
    \startplacefigure
        \startMPcode
            Test [ prefix = "Thin", color = "orange" ];
        \stopMPcode
    \stopplacefigure
\stopalignment

\color[Thin:orange]{goodbye}

\stoptext

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


Kevin W. Rudd, Ph.D.
CAPT, USN (Ret)

Computer Architecture & Computer Engineering
Advanced Computing Systems (ACS) Research Program
Laboratory for Physical Sciences (LPS)

443-654-7878
kevin@lps.umd.edu<mailto:kevin@lps.umd.edu>

Visiting Research Professor
United States Naval Academy

rudd@usna.edu<mailto:rudd@usna.edu>




[-- Attachment #1.2: Type: text/html, Size: 7411 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2021-07-22 14:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-22 12:59 another MetaPost question (this time on ConTeXt->MetaPost Rudd, Kevin
2021-07-22 14:13 ` Rudd, Kevin [this message]
2021-07-22 14:44 ` 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=5ACE1373-F089-4A4F-B76D-4A810043012F@lps.umd.edu \
    --to=kevin@lps.umd.edu \
    --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).