radial gradients #75

tsaizhenling opened this Issue Apr 30, 2013 · 3 comments

2 participants


any plans to implement radial gradients? I believe it has not been implemented yet.
screen shot 2013-05-01 at 1 10 29 am

the sample provided actually has a radial gradient in the eye.
screen shot 2013-05-01 at 1 10 50 am

also, looks like the linear gradients are a little buggy.
screen shot 2013-05-01 at 1 12 17 am
screen shot 2013-05-01 at 1 12 26 am


Good catch.

If you search the source for "gradient", I think you can add support for radial gradients very easily - maybe as little as 5-10 lines of code.

For the bug in linear gradients - are you sure that's a linear gradient? Maybe it's a radial gradient and a linear together? If it's definitely a bug, then ... again, the code for gradients is very simple (it uses Apple's CAGradientLayer to do 95% of the work) so I recommend experiementing with it see if you can find/fix it directly


its is a linear gradient and i found the bug. submitted a pull request for the fix.

radial gradients.. are not supported by CAGradientLayer unfortunately, but we can draw radial gradients with quartz commands so i think thats the only way to do it. will tinker with this when i have more time.


Fix merged into branch 1.1.0 - https://github.com/SVGKit/SVGKit/tree/1.1.0

@adamgit adamgit closed this May 5, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment