if i want to retrieve a themed color in a composab...
# compose
m
if i want to retrieve a themed color in a composable, not coming from the theme, but with corresponding dark/light variant, is this the correct approach for colors:
Copy code
val error: Color
    @Composable get() = if(isSystemInDarkTheme()) error else error2
d
it can work if your theme mode (dark/light) is always same as system mode anyway, it is better to have your own color palette and to use color from theme only
a
You may want to use
MaterialTheme.colors.isLight
instead of
isSystemInDarkMode()
.