For a full compose app with multiple themes, is th...
# compose
m
For a full compose app with multiple themes, is there any solution yet to themed vector drawables, like ( android:fillColor=“?attr/colorPrimary” ). Or we still need to define xml themes ?
c
If you use vector drawables in
Icon
you can always pass a color via tint, which could be from your theme
But that’s only if your art is intended to be one color. If not, then XML themes is one approach, or you could convert the VD into a Kotlin function with path draw commands and control it that way instead
m
if single color, ya
is there any kind of conversion tool or sth?
c
Not officially, but this is how we do the icons in the Material icons library: https://kotlinlang.slack.com/archives/CJLTWPH7S/p1638928779262800?thread_ts=1638925890.260400&cid=CJLTWPH7S
a
Would be great to have that tool or the classes for it exported in some compose package. Today anyone would need to copy paste a bunch of code
c
Agreed - it’s something we’re considering to pursue this year as we also consider how VD should continue to operate in Compose land.
a
Someone has already done that. https://github.com/DevSrSouza/svg-to-compose
👍 2
c
Oh nice did not know that happened!