ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* another MetaPost question (this time on ConTeXt->MetaPost
@ 2021-07-22 12:59 Rudd, Kevin
  2021-07-22 14:13 ` another MetaPost question (this time on ConTeXt->MetaPost color transfer) Rudd, Kevin
  2021-07-22 14:44 ` another MetaPost question (this time on ConTeXt->MetaPost Hans Hagen
  0 siblings, 2 replies; 3+ messages in thread
From: Rudd, Kevin @ 2021-07-22 12:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Rudd, Kevin


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


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;

        fill s withpen pencircle scaled 5pt withcolor p&c;
        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: 5826 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
___________________________________________________________________________________

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

* Re: another MetaPost question (this time on ConTeXt->MetaPost color transfer)
  2021-07-22 12:59 another MetaPost question (this time on ConTeXt->MetaPost Rudd, Kevin
@ 2021-07-22 14:13 ` Rudd, Kevin
  2021-07-22 14:44 ` another MetaPost question (this time on ConTeXt->MetaPost Hans Hagen
  1 sibling, 0 replies; 3+ messages in thread
From: Rudd, Kevin @ 2021-07-22 14:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Rudd, Kevin


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

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

* Re: another MetaPost question (this time on ConTeXt->MetaPost
  2021-07-22 12:59 another MetaPost question (this time on ConTeXt->MetaPost Rudd, Kevin
  2021-07-22 14:13 ` another MetaPost question (this time on ConTeXt->MetaPost color transfer) Rudd, Kevin
@ 2021-07-22 14:44 ` Hans Hagen
  1 sibling, 0 replies; 3+ messages in thread
From: Hans Hagen @ 2021-07-22 14:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Rudd, Kevin

On 7/22/2021 2:59 PM, Rudd, Kevin wrote:
> 
> 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….

I need to catch that case (string spot) indeed but even then, you need 
in your case

  p & ":" & c;

you missed the colon. Anyway, fixed in next upload.
  Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________

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

end of thread, other threads:[~2021-07-22 14:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-22 12:59 another MetaPost question (this time on ConTeXt->MetaPost Rudd, Kevin
2021-07-22 14:13 ` another MetaPost question (this time on ConTeXt->MetaPost color transfer) Rudd, Kevin
2021-07-22 14:44 ` another MetaPost question (this time on ConTeXt->MetaPost 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).