Skip to content
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

Animating color gradient changes #45

Open
tiagopigatto opened this issue Aug 30, 2023 · 0 comments
Open

Animating color gradient changes #45

tiagopigatto opened this issue Aug 30, 2023 · 0 comments

Comments

@tiagopigatto
Copy link

First of all, congrats on building this lib, it's really useful! One use case that I came across was animating a color change from a gradient to another from a single node. I tried using this piece of code provided from previous questions, but this would only apply animation changes to flat colors:

func tint(_ node: SVGNode, color: SVGColor) {
        if let group = node as? SVGGroup {
            for content in group.contents {
                tint(content, color: color)
            }
        } else if let shape = node as? SVGShape {
            shape.fill = color
        }
    }

Is there a way to achieve this with the current state in which the framework is in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant