Skip to content

Instantly share code, notes, and snippets.

@V-Abhilash-1999
Created May 23, 2023 12:25
Show Gist options
  • Save V-Abhilash-1999/a3a8037f94b75b1430d5e92cab3da36c to your computer and use it in GitHub Desktop.
Save V-Abhilash-1999/a3a8037f94b75b1430d5e92cab3da36c to your computer and use it in GitHub Desktop.
scope.launch {
interactionSource.interactions.collect { interaction ->
when(interaction) {
PressInteraction.Press -> {
val pressPos = pressPosition.x.coerceIn(0f..drawScopeSize.width)
pressOffset.value = Offset(pressPos, 0f)
val selectedHue = pointToHue(pressPos)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment