Am drawing a simple circle in a Canvas on Android.
Now I need to fill it with some gradient colors, but they are no really smooth.
This its what i have done:
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
rectF.set(20, 20, this.get_Width() - this.get_Width()/10, this.get_Width() - this.get_Width()/10);
RadialGradient gradient = new RadialGradient(200, 200, 200, 0xFFFFFFFF,
0xFF000000, android.graphics.Shader.TileMode.CLAMP);
Paint mPaint = new Paint();
mPaint.setDither(true);
mPaint.setShader(gradient);
canvas.drawCircle(getWidth()/2, getHeight()/2, getWidth()/3, getGradient());
invalidate();
}
And this is the result:

My question is: Is it there some way to make HQ radial gradients?
Finally I should initialize my Paint object as:
That makes the borders cleaner.
And with the @Waqas answer, make the colors itself smoothers.