https://kotlinlang.org logo
Title
n

Nikolas Alvelo

04/11/2022, 4:14 PM
Any thoughts on a Brush that can be used with
drawArc
that has different colors along the arc based on the arc’s sweep angle? We can get most of the way there with sweepGradient but ideally we wouldn't have the actual gradients and just solid color transitions between arc segments
Animating several stacked
drawArc
calls on top of each other has proven…horrifying
r

romainguy

04/11/2022, 4:24 PM
You can use SweepGradient. The trick is to use color stops of the same color
For instance red, red, blue, blue at positions 0,0.5,0.5,1 will create no gradient
n

Nikolas Alvelo

04/11/2022, 4:25 PM
Oooooo
Clever, I'll give it a try, thank you