I’m using CustomPaint to make a custom shape and I want to apply a color gradient but with hard color stops. Without color transitions.
PS:I cannot use different Paints instead of gradient because of the custom shape.
I checked the documentation and couldn’t find anything. Is it impossible? Or is there any other workarounds? Thanks!
Okay I figured it out myself, I use Gradient.linear as the shader for custom paint. I noticed that it only blends colors when there is a big gap in stops. So I put my colors and stops like this.
Colors | Stop
Now the color stops are hard.
Answered By – Sewmina Dilshan
Answer Checked By – Pedro (FlutterFixes Volunteer)