Update color preview

This commit is contained in:
Andrew 2024-06-12 12:35:32 +09:30
parent cf1649a6af
commit c44e75fe78

View File

@ -78,18 +78,34 @@ fun transparentButtonColors() = ButtonDefaults.buttonColors(backgroundColor = Co
@Composable @Composable
fun destructiveButtonColors() = ButtonDefaults.buttonColors(backgroundColor = Color.Transparent, contentColor = colorDestructive) fun destructiveButtonColors() = ButtonDefaults.buttonColors(backgroundColor = Color.Transparent, contentColor = colorDestructive)
@Preview @Composable fun ClassicLight() { Colors("classic light", classicLightColors) }
@Preview @Composable fun ClassicDark() { Colors("classic dark", classicDarkColors) }
@Preview @Composable fun OceanLight() { Colors("ocean light", oceanLightColors) }
@Preview @Composable fun OceanDark() { Colors("ocean dark", oceanDarkColors) }
@Composable
fun Colors(name: String, colors: List<Color>) {
Column {
colors.forEachIndexed { i, it ->
Box(Modifier.background(it)) {
Text("$name: $i")
}
}
}
}
@Preview @Preview
@Composable @Composable
fun PreviewMessageDetails( fun PreviewThemeColors(
@PreviewParameter(ThemeResPreviewParameterProvider::class) themeResId: Int @PreviewParameter(ThemeResPreviewParameterProvider::class) themeResId: Int
) { ) {
PreviewTheme(themeResId) { PreviewTheme(themeResId) {
Colors() ThemeColors()
} }
} }
@Composable @Composable
private fun Colors() { private fun ThemeColors() {
AppTheme { AppTheme {
Column { Column {
Box(Modifier.background(MaterialTheme.colors.primary)) { Box(Modifier.background(MaterialTheme.colors.primary)) {