[cairo] Path Gradients

Bobby Salazar bobby8934 at inbox.com
Wed Jan 23 09:34:23 PST 2008

I think that this (with reflect turned off) is exactly what I'm looking for! I really like the way it renders the glyph. In fact, it very nicely solves a problem that using a single center point causes - which is that the gradient along the edge is not the same width for non-uniform shapes like a rectangle. Also, using your pre-compiled demo app, can you adjust the scaling for the rendered image, or stretch it in any way? I would be interested to see how the gradient is affected by transformations.

Would this be difficult to implement in Cairo, anyone?

> -----Original Message-----
> From: milan at marusinec.sk
> Sent: Wed, 23 Jan 2008 02:19:53 +0000
> To: cairo at cairographics.org
> Subject: Re: [cairo] Path Gradients
> Hello Bobby,
>> However, there is one situation (that is my main interest in the path
>> gradient) that I cannot figure out how to map to these "Type 6" gradient
>> meshes. This situation is where you have a path, and you want to make a
>> gradient from an abitrary "center point" out to the edges, with color
>> stops along the way. Can you think of an easy way to use a "Type 6"
>> gradient mesh to reproduce the gradients seen in these images:
>> http://www.bobpowell.net/pgb.ht4.jpg
>> http://www.bobpowell.net/pgb.ht6.jpg
> I think, I have recently implemented the thing you want.
> Have a look at:
> http://www.aggpas.org/aggpas-demo.htm#ContourGradient
> It is done for different library than cairo and it is
> in Pascal, but the alghorithm (which could be ported
> to cairo) is there and it's licence allows you to do so.
> Basically, the whole thing is about firstly computing
> the so called Distance Transform (DT) from any arbitrary
> shape, which then further serves as a source of color
> transition levels. It's also pretty fast. You can also
> download a compiled executable demo and play with it a little.
> Cheers
> Milano
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo

Receive Notifications of Incoming Messages
Easily monitor multiple email accounts & access them with a click.
Visit http://www.inbox.com/notifier and check it out!

More information about the cairo mailing list