Open dalewking opened 3 months ago
This is what I implemented in our code:
@Composable
fun ColorDesc.localized(): Color = when (this) {
is ColorDescResource -> colorResource(resource)
is ColorDescSingle -> Color(color.argb)
is ColorDescThemed -> when {
isSystemInDarkTheme() -> Color(darkColor.argb)
else -> Color(lightColor.argb)
}
else -> throw NotImplementedError()
}
StringDesc has a localized function, but for some reason ColorDesc does not.