[metapost] Problem with colors

Steve Checkoway s at pahtak.org
Sun Aug 8 15:12:20 CEST 2010


On Aug 7, 2010, at 22:39 , Taco Hoekwater wrote:

> On 08/07/2010 10:25 PM, Steve Checkoway wrote:
>> If I use the following MP program, I get a red X exactly as I would expect. If I change red to any of cyan, magenta, or yellow, I get an error. I'm not entirely sure what I'm doing wrong.
>> 
>> If I change the \color{yellow} to \color[rgb]{1,1,0} then I can get yellow text. (Presumably, I can do the same with cyan or magenta, but I didn't test it.)
> 
> Can you post the .mpx file contents? I cannot predict what
> in the dvi (and therefore in the mpx) file.

Sure.

% Written by metapost version 1.208
begingroup save _p,_r,_s,_n; picture _p; _p=nullpicture;
string _n[];
vardef _s(expr _t,_f,_m,_x,_y)(text _c)=
  addto _p also _t infont _f scaled _m shifted (_x,_y) _c; enddef;
_n0="cmr10";
_s("X",_n0,1.00000,0.0000,0.0000, withcolor cmyk(0,0,1,0)
);
setbounds _p to (0,0.0000)--(7.4720,0.0000)--
 (7.4720,6.8078)--(0,6.8078)--cycle;
_p endgroup
mpxbreak

It looks like that should be withcmykcolor (0,0,1,0).

Someone offlist suggested that I try \usepackage[usenames,dvipsnames] and Yellow instead of yellow. In that case, I get withcolor (1.0,1.0,0.0) in the mpx file which works.

-- 
Steve Checkoway







More information about the metapost mailing list