[metapost] rfc: consistent color values

Dan Luecking luecking at uark.edu
Fri Apr 8 19:24:38 CEST 2005


At 07:39 AM 4/8/2005, you wrote:


>>>IMO MP should either disallow negative color values
>>>(err message) or should not change the values
>>>to 0 as long as the values are accessible on macro level
>>>(before shipout).
>
>It looks like this can be classified as an oversight (bug),
>because the documented behaviour is:
>
>"... all components are snapped back to the [0, 1] range
>      when a color is given in a PostScript output file."
>
>so clearly the picture iteration should have reported the
>values with their negative components still intact.
[...]

>I believe this is a bug (because the actual documentation makes
>no mention of picture variables), so I think a fix is needed.

I think this should be classified as a documentation bug. I would
prefer changing the documentation to changing the behavior. When
I examine the color of picture components, I want to see the color it
would get at shipout. But I would also like color expressions to be allowed
to have values outside the 0--1 range, if only because it would simplify
calculations with colors. (Not to mention that some packages misuse color
for spacial coordinates in 3D drawings.)

Probably the documentation oversite is because some of the
documentation was written before the addition of commands that allow
one to examine picture components.

Also the wording (above) can easily be construed as stating only that
colors in the PS file are restricted to the 0--1 range, and leaving the
timing of that truncation open: "...when the color is given in a PS
output file..." is not the same as "...at the moment the picture is
written to the PS output...".

I asked about the timing of this truncation on the MF list a couple of
years ago precisely because the wording didn't make it clear, and John
Hobby said that the addto operation adds truncated colors but that color
variables and expressions remain unchanged. So it seems the present behavior
was intended.

Regards,
Dan


Daniel H. Luecking
Department of Mathematical Sciences
University of Arkansas
"Be kind. Every person you meet is fighting a hard battle." - Anon.



More information about the metapost mailing list