gizeh icon indicating copy to clipboard operation
gizeh copied to clipboard

Input to 'radial' ColorGradient

Open jmlorenzi opened this issue 10 years ago • 5 comments

I am trying to use the ColorGradient(type='radial', ... ) and getting confused with the meaning of xy1, xy2 and xy3. Going through cairocffi's docstrings, I see that cairocffi.RadialGradient takes (cx0, cy0, radius0, cx1, cy1, radius1) as arguments, instead of the coordinates of three points. Maybe the optional xy3 should be replaced by (r1,r2)? Or am I missing something?

In any case, thanks for this great module!

jmlorenzi avatar Jan 20 '15 11:01 jmlorenzi

I must admit I am not sure either. If you feel confident, I'd gladly accept a commit. I think I'll have to update all the examples then.

Zulko avatar Jan 31 '15 10:01 Zulko

from this documentation @ http://docs.go-mono.com/index.aspx?link=T%3aCairo.RadialGradient the RadialGradient class:

Extends Cairo.Gradient to create a new radial gradient between the two circles defined by (cx0, cxy0, radius0) and (cx1, cy1, radius1).

such that we should have this equivalence

xy1, xy2, xy3 = (cx0, cy0), (cx1, cy1), (radius0, radius1)

a MWE should be more helpful :-)

laurentperrinet avatar Feb 16 '15 16:02 laurentperrinet

what"s an MWE ? Edit: Minimal working example ?

Zulko avatar Feb 16 '15 16:02 Zulko

I made a notebook showing some fiddling with these parameters:

https://laurentperrinet.github.io/sciblog/posts/2015-02-17-creating-an-animation-using-gizeh-+-moviepy.html

laurentperrinet avatar Feb 17 '15 12:02 laurentperrinet

Did you ever figure out how to get this to work? Here is some sample code (using a different Python binding for Cairo) if it will help; corresponding output can be seen here.

ldo avatar Sep 04 '21 01:09 ldo