Reputation: 3403
I need to draw a line with a varying gradient in a canvas. Any idea how to do this? I have done a lot of search and have not been able to find any answer.
Upvotes: 0
Views: 1126
Reputation: 5035
Use the setShader()
method on your Paint
object to set it to a gradient (likely a LinearGradient
, but there are a handful of things you can use. Check the documentation). Then draw away!
Upvotes: 1