-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds gradient export to SVG library #929
Conversation
…dial gradients to export as SVG The extension handler is a copy of https://gist.github.com/msteiger/4509119 by Martin Steiger with minor changes for Processing Several classes and methods in PShapeSVG and PShapeJava2D have been made public or modified to support the export of gradients
Hi @tracerstar, thank you for this PR! Could you provide an example on how this new functionality would be used? I'd like to test the functionality you wrote, other than that it looks good! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, tested on macOS arm64 and works as expected!
BIG |
@all-contributors please add @tracerstar for code |
I've put up a pull request to add @tracerstar! 🎉 |
Adding an extension handler to the SVG library to allow linear and radial gradients to export correctly as SVG (currently they export as solid black fills).
The extension handler is a copy of https://gist.github.com/msteiger/4509119 by Martin Steiger with minor changes for Processing.
Several classes and methods in PShapeSVG and PShapeJava2D have been made public or modified to support the export of gradients.
Current SVG export of gradients results in
fill:none
on the shapes, leaving everything filled black. This adds gradients into the export handler, allowingfill:url(#gradientID)
to work as expected.I originally made this pull request in August 2023 against the old processing4 repo, but I saw that git activity had recently started up again so wanted to make a new PR.