https://kotlinlang.org logo
#compose-android
Title
# compose-android
k

KodePlateform

09/07/2023, 5:06 AM
Hello Everyone, I am working on a project using Jetpack Compose Multiplatform, and I have stumbled upon an issue that I am finding challenging to solve. I have an SVG file that I converted into an XML drawable using Android Studio. The XML drawable contains paths with specific fill colors, and my goal is to dynamically replace a specific color attribute within the drawable with a color variable sourced from MaterialTheme at runtime. with attribute or android cvolors i got:
java.lang.IllegalArgumentException: Invalid color value ?attr/colorControlNormal or Invalid color value   @android:color/white
So is there a way to fill a specific path with for exemple MaterialTheme.colorScheme.onSurface ?
k

KodePlateform

09/07/2023, 7:13 AM
thank you, i ended up spliting image in two parts and applied a tintt to the desired part
9 Views