[metapost] greypart and other color queries.

Dan Luecking luecking at uark.edu
Fri May 29 21:04:48 CEST 2009


This works:
   draw (0,0)--(10,10) withcolor .6;
   show greypart currentpicture;
and shows 0.6.

But, contrary to mpman (section 6.3, page 20), this does not
work:
   numeric C; C:=0.6;
   show greypart C;
When C is a greyscale color (i.e., a numeric), it always
shows 0. Have I misunderstood something?

The documentation of defaultcolormodel is rather unclear.
What is the effect of changing it? As near as I can tell,
every drawing object that lacks a withcolor clause is
preceded in the  output by setting the color to black in the
defaultcolormodel. Are there any other effects?

The table on page 30 mysteriously maps "withcolor true" to
"<current default color model>" which is not any kind of
with-operator at all. What does "draw p withcolor true;"
accomplish? As near as I can determine from tests it does
absolutely nothing. It seems it _ought_ to cancel a previous
"withcolor false" according to this quote:
   "the last withcolor, withrgbcolor, withcmykcolor,
    withgreyscale or withoutcolor specification sets the
    color model for any particular object"
but it doesn't. Is this a bug? If it is intended, the table
ought to say it is mapped to <empty> and the text should
explain that the above quote doesn't apply.

Paradoxically (for those who think of black-and-white pictures
as being without color):
     draw p withcolor red;
     draw q withcolor true;
produces q in black, while
     draw p withcolor red;
     draw q withoutcolor;% or withcolor false
produces q in red.


Regards,
Dan


Daniel H. Luecking
Department of Mathematical Sciences
University of Arkansas
"Dubito ergo cogito, cogito ergo sum" --Descartes



More information about the metapost mailing list