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
Respect fill=currentColor for svg images by referencing content color in theme #1209
Comments
(BTW, I'm aware of |
Does |
I figured out how to set the path color in AndroidSVG, they expect you to pass it as CSS:
(See androidsvg#11) Converting a Compose color to hex string:
It's funny to me that this will perform so many different type conversions of a colour value, but alas. The only thing I could not figure out is where to pass in
But I don't know how |
@digitalheir Thanks for looking into this! I added an |
Thank you! Suppose it's even better like this because it enables the developer to make the call on whether an |
Is your feature request related to a problem? Please describe.
I want to load a bunch of svg's which have their fill specified as
currentColor
. The color appears black in both light mode and dark mode. This looks bad for my app.looking into the source code of caverock-androidsvg, I see that:
Describe the solution you'd like
It would be grand if either of these happened:
AsyncImage
composable automatically picks up theLocalContentColor.current
composition local and passes it toSvgDecoder
to set the svg style.currentColor
, were exposed inSvgDecoder
AndroidSVG
was exposed as a transitive API in Coil (I wouldn't like this solution actually)Additional context
Example svg:
The text was updated successfully, but these errors were encountered: