[metapost] rfc: consistent color values

Hans Hagen pragma at wxs.nl
Fri Apr 8 13:35:49 CEST 2005


Jens-Uwe Morawski wrote:
> Hello
> 
> Since Taco told about a MP 1.0 release later this year, IMO
> the following problem should be discussed before.
> 
> In the example below you can see that MP replaces
> silently all negative color values with 0.
> 
> %%%
> picture P ; P := nullpicture ;
> 
> addto P doublepath origin withcolor (-1,0.5,0.5) ;
> addto P doublepath origin withcolor (-1,-0.5,0.5) ;
> addto P doublepath origin withcolor (-1,0.5,-0.5) ;
> addto P doublepath origin withcolor (-1,-0.5,-0.5) ;
> 
> for I within P:
> 	show (redpart I, greenpart I, bluepart I) ;
> endfor;
> end
> %%%
> 
> 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).
> The latter would even allow tagging of objects, for example
> to apply a transformation to objects with redpart=-1
> when the transformation was still unknown when the
> object has been drawn.
> 
> Is this possible to change? Makes it sense?
> Ideas? Comments?

i agree that the behaviour should be:

- honor negative color components
- clip to zero when output as color

if we see color as an 3-number daat structure, it should be possible to (mis)use 
it anyway which is why negative values need to be honored, also,

color diminish ; diminish := (-.5,-.2,.-3) ;

... withcolor (red+diminish)

should be possible (so, actually, the current clipping is a bug)

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------



More information about the metapost mailing list