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();
	} 
 
    public void setColor(int color) {
        float[] hsv = Utils.color2HSV(color);
		mHue = hsv[0];
 
        mColor.setColor(color);
        applyChanges(getWidth(), getHeight());
 
    }