[cairo] API Shakeup: cairo_set_rgb_color

Bill Spitzak spitzak at d2.com
Tue Feb 15 17:24:58 PST 2005



Carl Worth wrote:

> Allowing pre-multiplied colors does allow
> the user to supply super-luminescent colors, (where color components
> have values greater than alpha), which can be interesting.

Actually, since cairo_set_source_rgba takes double as the type of 
parameter, you can do this with the other interface as well by setting 
r,g,or b to a value greater than 1.0.

In any case this all sounds very good.

Only concern I have is that GDI+ allows a source image to "fade out" by 
multiplying by a constant at the moment it is composited. It looks like 
this may require drawing a temporary image in Cairo which could be a 
problem if programs are relying on it a lot. An alternative approach 
would be to have the "color" be seperate from the "source" and the 
source is multiplied by this color before being used. Solid fill would 
be done by a special "solid white" source and setting the color. This 
would allow a fade-out by setting the color all equal to the GDI+ 
multiplier value. It could also tint by setting the color in other ways, 
though I'm not sure if this produces any useful graphic result.

In any case that is only a minor suggestion. If Cairo makes it fairly 
easy to achieve the "fade out" effect in some other way using surfaces 
than it probably means it is better able to support other effects as 
well, so this is not needed.



More information about the cairo mailing list