I would like to draw a circle filled with blended color with gradient. However, the existing android.graphics.Shader subclasses cannot meet my need. In short, I would like to control the color of each pixel in the circle myself. Is it possible to implement a custom Shadar object by extending android.graphics.Shader?
In Android, Shader defines the color(s) or the texture with which the Paint object should draw (other than a bitmap). Android defines several subclasses of Shader for Paint to use, such as BitmapShader , ComposeShader , LinearGradient , RadialGradient , and SweepGradient .
I am not sure about subclassing android.graphics.Shader
But if you are using OpenGl ES 2.0 you can write your own Shader using GLSL which gives you very high flexibilty.
Maybe have a look at this question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With