flosch
04/18/2020, 10:05 AMColorPalette
appwide like that:
object AppColors {
private val primaryColor: Color = Color(0x464763)
val lightPalette: ColorPalette = lightColorPalette(
primary = primaryColor
)
val darkPalette: ColorPalette = darkColorPalette(
primary = primaryColor
)
@Composable
val currentPalette: ColorPalette
get() = if (isSystemInDarkTheme()) darkPalette else lightPalette
}
When I use it for my MaterialTheme(colors = AppColors.currentPalette) { … }
, the primary color is just invisible or set to transparent, what am I doing wrong?
If I dont overwrite the primary, then everything works as expected (images in thread).primary
primary
Andrey Kulikov
04/18/2020, 11:25 AMColor(0xFF464763)
flosch
04/18/2020, 11:26 AMAndrey Kulikov
04/18/2020, 3:43 PMGabriel Feo
04/21/2020, 12:40 AMMaterialTheme
flosch
04/21/2020, 7:42 AMChris Sinco [G]
04/21/2020, 4:17 PMColor
is used via the gutter icon. Also very useful for converting alpha % to hex.Gabriel Feo
04/21/2020, 6:57 PM