Hey guys, I'm trying to display an `icon.xml` that...
# compose
k
Hey guys, I'm trying to display an
icon.xml
that has a gradient. when using
Res.drawable.icon
the icon appears black only showing the outline. Is it possible to display icons with gradients in compose-multiplatform?
s
If you use
Image
instead of
Icon
is there any difference? Icon applies a tint by default which may affect how things render
k
@Stylianos Gakis Great recommendation 👍. Using
Image
solves the problem. The default tint is only used in
Icon
.
s
You can also pass in
tint = Color.Unspecified
explicitly on your Icon and I think it will also not apply any tint. But yeah, it's a common gotcha in compose.
k
Thanks @Stylianos Gakis the tint unspecified also solved it. Much appreciated. I was going to use
coil-svg
to solve it, but your solution is much better.
🌟 2