Skip to content

Commit

Permalink
UI에서 colorInt 대신 compose Color 사용
Browse files Browse the repository at this point in the history
  • Loading branch information
eastshine2741 committed Jan 24, 2024
1 parent b9b95b1 commit 4d7b599
Showing 1 changed file with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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)
},
Expand All @@ -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)
},
Expand Down

0 comments on commit 4d7b599

Please sign in to comment.