Usually I have 1 color svg-s, like: that look like:
<?xml version="1.0" encoding="utf-8"?> <svg width="40" height="40" viewBox="1 1 22 22" fill="none" stroke-width="4" stroke-linecap="square" xmlns="http://www.w3.org/2000/svg"> <path id="3" d="M22 9h-13" stroke="#000000"/> </svg>
and I include them in my app like:
<drawables> <bitmap id="test" filename="test.svg" dithering="none"> <palette disableTransparency="false"> <color>000000</color> </palette> </bitmap> <bitmap id="test_dark" filename="test.svg" dithering="none"> <palette disableTransparency="false"> <color>FFFFFF</color> </palette> </bitmap> </drawables>
and in my code I do something like:
WatchUi.loadResource(getBackgroundColor() == COLOR_BLACK ? Rez.Drawables.test_dark : Rez.Drawables.test);
Now I'd like to have an svg with 2 colors: sorry, original svg couldn't be uploaded. but it's this:
<?xml version="1.0" encoding="utf-8"?>
<svg width="40px" height="40px" viewBox="1 1 22 22" fill="none" stroke-width="4" stroke-linecap="square" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg">
<path id="4" d="M22 3h-19" stroke="#AAAAAA"/>
<path id="3" d="M22 9h-13" stroke="#AAAAAA"/>
<path id="2" d="M22 15h-7" stroke="#000000"/>
<path id="1" d="M22 21h-1" stroke="#000000"/>
</svg>
And I'd like to be able to use this similar to the 2 color version above, just with the following change:
<drawables>
<bitmap id="test" filename="test2.svg" dithering="none">
<palette disableTransparency="false">
<color>000000</color>
<color>AAAAAA</color>
</palette>
</bitmap>
<bitmap id="test_dark" filename="test2.svg" dithering="none">
<palette disableTransparency="false">
<color>FFFFFF</color>
<color>555555</color>
</palette>
</bitmap>
</drawables>
Notice, that in the dark I not only added a 2nd color to the palette but I also changed the AAAAAA (that is in the svg) to 555555 (because that's the "inverse" what I need in a dark background)
However this doesn't work, and I hope it should work, just that I am doing something wrong. Did anyone manage to do something like this?