BigBadaboom / androidsvg

SVG rendering library for Android
http://bigbadaboom.github.io/androidsvg/
Apache License 2.0
1.21k stars 231 forks source link

Make fallback color configurable #264

Closed mueller-ma closed 1 year ago

mueller-ma commented 1 year ago

If a svg doesn't contain any color information, it will be rendered in black. This can cause issues when the icon is used on a dark background as the color ratio is too low then.

Example:

Screenshot_20230207-182555 Screenshot_20230207-182635

Here's another icon without color information:

window-closed-variant

The icons in this app are user defined, so it's not possible for me to add an color to them. It would help to add a parameter "fallback color" to functions that render a SVG.

maniac103 commented 1 year ago

It would help to add a parameter "fallback color" to functions that render a SVG.

... or make that fallback color part of the RenderOptions.

BigBadaboom commented 1 year ago

You can pass some CSS with the RenderOptions. Does that not meet your needs?

mueller-ma commented 1 year ago

Using CSS to set a value for currentColor did it! 👍