Join Slack
Powered by
Was hoping Compose had a Color.blend() function th...
# compose
t
Travis Griggs
10/23/2023, 7:50 PM
Was hoping Compose had a Color.blend() function that allows colors to be mixed. I'll write my own unless someone tells me there's one by a name I'm just not seeing yet
f
Francesc
10/23/2023, 7:52 PM
there is
lerp
which takes 2 colors and merges them
Francesc
10/23/2023, 7:53 PM
https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/package-summary#lerp(androidx.compose.ui.g[…]raphics.Color,kotlin.Float)
t
Travis Griggs
10/23/2023, 8:06 PM
🙏
e
ephemient
10/23/2023, 8:23 PM
all the unit types (such as Dp) have lerp functions
e
efemoney
10/24/2023, 9:12 AM
But lerp is not the same as merging / mixing two colors 🤔 (its sort of a fade from one to the other)
f
Francesc
10/24/2023, 3:36 PM
well, how do you define "merge"? lerp takes x from color 1 and blends it with (1-x) from color2, isn't that merging?
91
Views
Open in Slack
Previous
Next