ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* colors in MetaPost
@ 2019-09-11 11:46 Henning Hraban Ramm
  2019-09-11 12:18 ` Henning Hraban Ramm
  0 siblings, 1 reply; 3+ messages in thread
From: Henning Hraban Ramm @ 2019-09-11 11:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,
I’m trying to get a linear shade in the background of my presentation.
But it seems like MetaPost can’t handle my self-defined colors:


\definecolor[VerlaufVon][c=75,m=5,y=95,k=60]
\definecolor[VerlaufNach][c=88,m=95,y=5,k=60]

\startuniqueMPgraphic{Verlauf}
% old method, also doesn’t work
%  path p ;
%  p := unitsquare xscaled \overlaywidth yscaled \overlayheight ;
%  linear_shade(p,6,\MPcolor{VerlaufVon},\MPcolor{VerlaufNach}) ;

fill fullsquare xyscaled (\overlaywidth,\overlayheight)
  withshademethod "linear"
  withshadevector (0.5,2.5)
  %withshadedirection shadedup
  withshadecolors ("VerlaufVon", "VerlaufNach")
;
\stopuniqueMPgraphic

\defineoverlay[verlaufen][\useMPgraphic{Verlauf}]

\setupbackgrounds[paper][background={verlaufen}]

\starttext
\strut
\stoptext


The background consists of a blue and a green area instead of a shade. While testing I sometimes got a few more stripes in the top and bottom area, can’t reproduce any more.

I also tried RGB and hex (HTML) definitions. Predefined colors work.
According to the MetaFun manual, either \MPcolor{name} or just "name" should work.
What’s wrong?


Greetlings, Hraban
---
https://www.fiee.net
http://wiki.contextgarden.net
https://www.dreiviertelhaus.de
GPG Key ID 1C9B22FD

___________________________________________________________________________________
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: colors in MetaPost
  2019-09-11 11:46 colors in MetaPost Henning Hraban Ramm
@ 2019-09-11 12:18 ` Henning Hraban Ramm
  2019-09-11 12:31   ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Henning Hraban Ramm @ 2019-09-11 12:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 2019-09-11 um 13:46 schrieb Henning Hraban Ramm <texml@fiee.net>:
> \definecolor[VerlaufVon][c=75,m=5,y=95,k=60]
> \definecolor[VerlaufNach][c=88,m=95,y=5,k=60]

Of course I need values between 0 and 1.
Sorry for the noise.
I think I’m too tired...


Greetlings, Hraban
---
https://www.fiee.net
http://wiki.contextgarden.net
https://www.dreiviertelhaus.de
GPG Key ID 1C9B22FD

___________________________________________________________________________________
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: colors in MetaPost
  2019-09-11 12:18 ` Henning Hraban Ramm
@ 2019-09-11 12:31   ` Hans Hagen
  0 siblings, 0 replies; 3+ messages in thread
From: Hans Hagen @ 2019-09-11 12:31 UTC (permalink / raw)
  To: Henning Hraban Ramm, mailing list for ConTeXt users

On 9/11/2019 2:18 PM, Henning Hraban Ramm wrote:
> Am 2019-09-11 um 13:46 schrieb Henning Hraban Ramm <texml@fiee.net>:
>> \definecolor[VerlaufVon][c=75,m=5,y=95,k=60]
>> \definecolor[VerlaufNach][c=88,m=95,y=5,k=60]
> 
> Of course I need values between 0 and 1.
> Sorry for the noise.
> I think I’m too tired...
there is an alternative interface on top of the existing one (coming) ...

% maybe handy:

definecolor [ name = "MyColor3", r = 0.22, g = 0.44, b = 0.66 ] ;
definecolor [ name = "MyColor4", r = 0.66, g = 0.44, b = 0.22 ] ;

% parameter driven:

draw lmt_shade [
     path      = fullcircle scaled 4cm,
     direction = "right",
     domain    = { 0, 2 },
     colors    = { "MyColor3", "MyColor4" },
] ;

but tweaking shades will never be easy

Hans

(working in the metafun xl manual, more soon)

-----------------------------------------------------------------
                                           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:[~2019-09-11 12:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-11 11:46 colors in MetaPost Henning Hraban Ramm
2019-09-11 12:18 ` Henning Hraban Ramm
2019-09-11 12:31   ` 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).