Code example for SweepGradient

0
	public ColorPickerView(Context c, OnColorChangedListener l, int color) {
		super(c);
		mListener = l;
		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);
		mPaint.setStrokeWidth(32);
 
		mCenterPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
		mCenterPaint.setColor(color);
		mCenterPaint.setStrokeWidth(5);
	} 
 
	private boolean mTrackingCenter;
	private boolean mHighlightCenter;
 
	/**