Code example for SweepGradient

0
 
        mColors = new int[] {
            0xFFFF0000, 0xFFFF00FF, 0xFF0000FF, 0xFF00FFFF, 0xFF00FF00, 
            0xFFFFFF00, 0xFFFF0000 
        }; 
        Shader s = new SweepGradient(0, 0, mColors, null);
         
        mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
        mPaint.setShader(s);
        mPaint.setStyle(Paint.Style.STROKE);
         
        mCenterPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
        mCenterPaint.setStrokeWidth(5);
	} 
     
    private boolean mTrackingCenter;
    private boolean mHighlightCenter;
 
    @Override  
    protected void onDraw(Canvas canvas) {
		float outer_radius = Math.min(getWidth(), getHeight())/2;