exyte / Macaw

Powerful and easy-to-use vector graphics Swift library with SVG support
MIT License
6.01k stars 553 forks source link

Color Gradient a node #747

Open TheBearF8 opened 3 years ago

TheBearF8 commented 3 years ago

Found your package from the Medium article "Interactive SVG images in Swift with Macaw" I have a SVG with many paths each with their own id I can change the color of the path with node.nodeBy(tag: ) .fill But is there a way to color gradient fill the path?

Thanks

ystrot commented 3 years ago

Hi Barry,

Yes, you can set up gradient using shape.fill = LinearGradient(...). There is more information about gradient: https://github.com/exyte/Macaw/wiki/Getting-started#coloring