For supporting dark theme, the documentation says ...
# compose
y
For supporting dark theme, the documentation says I have to use
Copy code
private val DarkColors = darkColors(
    primary = Yellow200,
    secondary = Blue200,
    // ...
)
private val LightColors = lightColors(
    primary = Yellow500,
    primaryVariant = Yellow400,
    secondary = Blue700,
    // ...
)
but these can hold like 10 variables, I need my own custom color variables which change depending on the theme. Its super easy to do using XML resources but I am unsure if that's what I should do. Should I just use xml resources for this? or is there a way to handle those in Compose?
b
If you have a design system that has its own color definition (i.e. the theme’s color names do not line up with Material’s) you likely want to create your own class. Here’s Material’s, which is fairly easy to reproduce with your own color names: https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/[…]onMain/kotlin/androidx/compose/material/Colors.kt?q=Colors.kt
🙌 1
y
Uh, didnt think of that. I will try that now. Thanks.