Billy Newman
01/24/2022, 6:44 PMval Grey900 = Color(0xFF212121)
With a Theme:
private val DarkColorPalette = darkColors(
primary = Grey900
)
And a button:
Button(onClick = {...}) {
Text(text = "BUTTON TEXT")
}
I am still seeing a text color of black, which is very hard to see on a button that dark. An I setting up my theme wrong, or is switching the text color on a button something that is left up to me?Casey Brooks
01/24/2022, 6:52 PMMaterialTheme.colors.isLight
to check if you're in a light or dark theme, and change the color dynamically. For example:
val Grey900 @Composable get() = if(MaterialTheme.colors.isLight) Color(0xFF212121) else Color(0xFFFFFFFF)
Louis Pullen-Freilich [G]
01/24/2022, 6:53 PMBilly Newman
01/24/2022, 7:54 PMonSurface: Color = Color.White,
Makes sense that this is what is being used for a button, since by default compose uses a surface of “primary”/.
onPrimary: Color = Color.Black,