Re: Conical Gradient

Simon Sapin <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
Le 29/01/2013 00:24, Bobby Salazar a écrit :
> Is it possible to create a conical gradient using Cairo? I would like
> to be able to produce an effect similar to this picture:
>
> http://2.bp.blogspot.com/-b1G6OHdoCIA/TcOh3HYCyjI/AAAAAAAAAbg/JYi-vFIBZDs/s1600/SingleConicalGradient.png
>
> Any help is appreciated!

Yes, since cairo 1.12, with mesh a pattern:

http://cairographics.org/manual/cairo-cairo-pattern-t.html#cairo-pattern-create-mesh

"Tensor-product patch meshes" are a super-set of many gradient types 
including (if I understand correctly) linear, radial and conical gradients.

It’s not super obvious, but you can get a conical gradient with one 
patch per "step", each shaped like a pie slice.

Might be useful: http://tavmjong.free.fr/SVG/MESH/Mesh.html

-- 
Simon Sapin
-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.