Code example for ComposeShader

0
 
		int rgb = Color.HSVToColor(new float[] { mHue, 1f, 1f });
		Shader satGradient = new LinearGradient(0, 0, w, 0, Color.WHITE, rgb,
				Shader.TileMode.CLAMP);
 
		ComposeShader shader = new ComposeShader(valGradient, satGradient,
				PorterDuff.Mode.MULTIPLY);
 
		mGradient.setShader(shader);
		invalidate();
	} 
 
	@Override 
	public void setColor(int color) {
		mColor.setColor(color);
 
		float[] hsv = Utils.color2HSV(color);
 
		mHue = hsv[0];
 
		applyChages(getWidth(), getHeight());