I draw a simple circle in Canvas on Android. Now I need to fill it with gradient colors, but they are not very smooth. This is what I did:
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 there a way to make HQ radial gradients?
source share