From 4d7b599b0bcf43e595a83b08b0dbbd9dc48bc7dc Mon Sep 17 00:00:00 2001 From: eastshine2741 Date: Wed, 24 Jan 2024 13:55:27 +0900 Subject: [PATCH] =?UTF-8?q?UI=EC=97=90=EC=84=9C=20colorInt=20=EB=8C=80?= =?UTF-8?q?=EC=8B=A0=20compose=20Color=20=EC=82=AC=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../home/settings/theme/ThemeDetailPage.kt | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/com/wafflestudio/snutt2/views/logged_in/home/settings/theme/ThemeDetailPage.kt b/app/src/main/java/com/wafflestudio/snutt2/views/logged_in/home/settings/theme/ThemeDetailPage.kt index 1ed54fd48..c64a2d4ae 100644 --- a/app/src/main/java/com/wafflestudio/snutt2/views/logged_in/home/settings/theme/ThemeDetailPage.kt +++ b/app/src/main/java/com/wafflestudio/snutt2/views/logged_in/home/settings/theme/ThemeDetailPage.kt @@ -294,8 +294,8 @@ fun ThemeDetailPage( exit = shrinkVertically(), ) { ColorEditItem( - fgColor = colorWithExpanded.item.fgColor ?: 0xffffff, - bgColor = colorWithExpanded.item.bgColor ?: 0xffffff, + fgColor = Color(colorWithExpanded.item.fgColor ?: 0xffffff), + bgColor = Color(colorWithExpanded.item.bgColor ?: 0xffffff), onFgColorPicked = { color -> themeDetailViewModel.updateColor( idx, @@ -434,8 +434,8 @@ fun ThemeDetailItem( @Composable fun ColorEditItem( - fgColor: Int, - bgColor: Int, + fgColor: Color, + bgColor: Color, onFgColorPicked: (Color) -> Unit, onBgColorPicked: (Color) -> Unit, modifier: Modifier = Modifier, @@ -461,16 +461,14 @@ fun ColorEditItem( ) Spacer(modifier = Modifier.width(11.dp)) ColorCircle( - color = Color(fgColor), + color = fgColor, modifier = Modifier .size(25.dp) .clicks { showColorPickerDialog( context = context, modalState = modalState, - initialColor = Color( - fgColor, - ), + initialColor = fgColor, onColorPicked = { color -> onFgColorPicked(color) }, @@ -487,16 +485,14 @@ fun ColorEditItem( ) Spacer(modifier = Modifier.width(11.dp)) ColorCircle( - color = Color(bgColor), + color = bgColor, modifier = Modifier .size(25.dp) .clicks { showColorPickerDialog( context = context, modalState = modalState, - initialColor = Color( - bgColor, - ), + initialColor = bgColor, onColorPicked = { color -> onBgColorPicked(color) },