[cairo] rsvg and colour

Donn donn.ingle at gmail.com
Wed Apr 29 14:55:09 PDT 2009


On Wednesday, 29 April 2009 11:47:59 Donn wrote:
> Is there any way to change the colour of a bunch of stuff all at once?

I have found this recipe for half of what I need:

ctx.push_group()
svghandle.render_cairo(ctx,id="#someid") # coloured svg
ctx.set_source_rgb(1,1,0)
ctx.rectangle(0,0,100,100) # yellow rectangle
ctx.fill()
p = ctx.pop_group()
ctx.set_source_rgba(0,0,1) # Make 'em all blue!
ctx.mask(p)
ctx.fill()

Great -- But how would I (in a loop) gradually shift that rectangle and that 
SVG handle from Blue ----> to ----> their native colours ?

I am just about done with my animation API and this is one of the last 
hold-ups, I hope someone can help me out.

\d
-- 
Where I web: http://otherwise.relics.co.za/
Comics, tutorials, software and sundry


More information about the cairo mailing list