Dynamically change SVG color or replace a color by another one
-
Hello,
I have a menu with SVG images. I would like to change their color on focus. My SVG are simple logo made of transparent and black for example this one :
What I want is to replace the black color by white without having to handle many images.
Is that possible ?
I tried ColorOverlay but it also replace the transparent with white color.Thank you in advance
-
I think that will help you:
https://forum.qt.io/topic/75115/qml-svg-change-color/6 -
I think that will help you:
https://forum.qt.io/topic/75115/qml-svg-change-color/6 -
Hi, I have no problems to color my svg files white with the approach mentioned by Bernd. Maybe the problem is in the format of your svg file (I had some problems with svg that contained groups or masks etc). To test that you could try a file from: https://material.io/tools/icons/?style=baseline
those usually work for me