Created
May 23, 2023 12:30
-
-
Save V-Abhilash-1999/af77abdcf9309c929ea17393cc32d8f5 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
Column( | |
modifier = Modifier | |
.fillMaxSize(), | |
horizontalAlignment = Alignment.CenterHorizontally, | |
verticalArrangement = Arrangement.Center | |
) { | |
val hsv = remember { | |
val hsv = floatArrayOf(0f, 0f, 0f) | |
AndroidColor.colorToHSV(Color.Blue.toArgb(), hsv) | |
mutableStateOf( | |
Triple(hsv[0], hsv[1], hsv[2]) | |
) | |
} | |
val backgroundColor = remember(hsv.value) { | |
mutableStateOf(Color.hsv(hsv.value.first, hsv.value.second, hsv.value.third)) | |
} | |
SatValPanel(hue = hsv.value.first) { sat, value -> | |
hsv.value = Triple(hsv.value.first, sat, value) | |
} | |
Spacer(modifier = Modifier.height(32.dp)) | |
HueBar { hue -> | |
hsv.value = Triple(hue, hsv.value.second, hsv.value.third) | |
} | |
Spacer(modifier = Modifier.height(32.dp)) | |
Box( | |
modifier = Modifier | |
.size(100.dp) | |
.background(backgroundColor.value) | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment