-
Notifications
You must be signed in to change notification settings - Fork 693
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
Question: What is the best way to color SVG? #6503
Comments
Any news month later? |
Similar to #3941 or #3974. Combining my comments from those: The current svg support is static with no object model support. The only option I can think of is to load the svg file into a buffer, lookup the color RGB values you need, search and replace them in the svg buffer, and then put that buffer in a stream to load it. Of course, you'll need to listen for theme changes and repeat this process when that happens. For more frequent changes, like hover and pressed, you'd likely want to save SvgImageSources for the manipulated SVGs. |
Thanks. Do you have any plans to implement the coloring of SVGs at the runtime? It would be powerful feature for icons. |
We don't currently have any plans for that. I'd like to expose an SVG object model so that you could at least have some code to go poke some values rather than fully reparse the SVG. But for a case like this you'd probably also want You might want to consider AnimatedIcon, which can change states (and animate). I'm not super familiar with this, but I believe it supports colors and you could set different states depending on the theme. High contrast theme likely would require more work to get and set the right RGB values. |
Closing as answered. |
Hi, how can I color the SVG? I want to use one SVG and change it's colors depending on the state: Dark\Light theme, Hover, Pressed, etc.
WinAppSDK 1.0 Desktop
The text was updated successfully, but these errors were encountered: