Dynamically change SVG color or replace a color by another one
-
wrote on 7 Jun 2018, 14:41 last edited by
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
-
wrote on 7 Jun 2018, 18:40 last edited by
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 -
wrote on 11 Jun 2018, 18:00 last edited by
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 -
wrote on 12 Jun 2018, 05:57 last edited by
Thank you for that answer, I believe is due to the device I'm trying to run it on, because on the computer it works quite good.
I hoped to have an other solution than this one. I will have to manage many images.
4/5