-
-
Save Peddro/d42411227c2acadd6866226392954ce7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val LightColors = H19Colors( | |
primary = Blue, | |
background = Color.White, | |
textPrimary = Color.White, | |
onPrimary = Color.White, | |
onBackground = DarkGrey, | |
isLight = true | |
) | |
class H19Colors( | |
primary: Color, | |
background: Color, | |
textPrimary: Color, | |
onPrimary: Color, | |
onBackground: Color, | |
isLight: Boolean | |
) { | |
var primary by mutableStateOf(primary) | |
private set | |
var background by mutableStateOf(background) | |
private set | |
var textPrimary by mutableStateOf(textPrimary) | |
private set | |
var onPrimary by mutableStateOf(onPrimary) | |
private set | |
var onBackground by mutableStateOf(onBackground) | |
private set | |
var isLight by mutableStateOf(isLight) | |
private set | |
fun copy( | |
primary: Color = this.primary, | |
background: Color = this.background, | |
textPrimary: Color = this.textPrimary, | |
onPrimary: Color = this.onPrimary, | |
onBackground: Color = this.onBackground, | |
isLight: Boolean = this.isLight | |
): H19Colors = H19Colors( | |
primary, | |
background, | |
textPrimary, | |
onPrimary, | |
onBackground, | |
isLight | |
) | |
fun updateColorsFrom(other: H19Colors) { | |
primary = other.primary | |
background = other.background | |
textPrimary = other.textPrimary | |
onPrimary = other.onPrimary | |
onBackground = other.onBackground | |
isLight = other.isLight | |
} | |
} | |
internal val LocalColors = staticCompositionLocalOf { LightColors } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment