[NTG-context] colors in MetaPost

Henning Hraban Ramm texml at fiee.net
Wed Sep 11 13:46:20 CEST 2019


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



More information about the ntg-context mailing list