Skip to content

Instantly share code, notes, and snippets.

@Peddro
Created Jan 26, 2022
Embed
What would you like to do?
@Composable
@ReadOnlyComposable
fun defaultContentColorFor(backgroundColor: Color): Color =
H19Theme.colors.contentColorFor(backgroundColor).takeOrElse { LocalContentColor.current }
private fun H19Colors.contentColorFor(backgroundColor: Color): Color {
return when (backgroundColor) {
primary -> onPrimary
background -> onBackground
else -> Color.Unspecified
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment