Code example for GradientDrawable

Methods: invalidateSelf, setColor

0
		return ("#" + byteToHex(Color.red(n))
			 + byteToHex(Color.green(n))
			 + byteToHex(Color.blue(n))).toUpperCase();
	} 
	private void updatePreview(int color) {
		mPreviewDrawable.setColor(color);
		mPreviewDrawable.invalidateSelf();
		mLabel.setText(colorToHex(mColor));
	} 
 
	public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
		if ( fromUser ) {
			if ( seekBar==mR || seekBar==mG || seekBar==mB )
				updateRGB(); 
			else 
				updateHSV(); 
		} 
	} 
 
	public void onStartTrackingTouch(SeekBar seekBar) {
	}