Paul Woitaschek
06/12/2021, 7:58 PMCompositionLocalProvider(LocalContentAlpha provides ContentAlpha.high)
. But that's a lot of overhead and it feels like working against the system.Louis Pullen-Freilich [G]
06/12/2021, 9:23 PMhigh
- different components by design / by specification use different levels of alpha to represent relative emphasis. For example a disabled component with ContentAlpha.high
text could easily be mistaken for an enabled componentPaul Woitaschek
06/12/2021, 9:48 PMPaul Woitaschek
06/12/2021, 9:48 PMMaterialTheme {
CompositionLocalProvider(
LocalContentColor provides Color.Red
) {
Text("Hello World")
}
}
Paul Woitaschek
06/12/2021, 9:49 PMval Red = Color(0xFFFF0000)
? #FF0000Louis Pullen-Freilich [G]
06/12/2021, 10:30 PMMaterialTheme
sets ContentAlpha.high
as the default for LocalContentAlpha
, and Text
will use `
LocalContentColor.current.copy(alpha = LocalContentAlpha.current)
by default if a color is not explicitly set