Code example for AvoidXfermode

0
 
		// then, set the Xfermode of the pain to AvoidXfermode 
		// removeColor is the color that will be replaced with the pain't color 
		// 0 is the tolerance (in this case, only the color to be removed is targetted) 
		// Mode.TARGET means pixels with color the same as removeColor are drawn on 
		paint.setXfermode(new AvoidXfermode(removeColor, 0, AvoidXfermode.Mode.TARGET));
 
		// draw transparent on the "brown" pixels 
		c.drawPaint(paint);
 
		// mb should now have transparent pixels where they were red before 
		return mb;
	} 
	 
	public int getDrawWidth(){ 
		return drawWidth;
	} 
	 
	public Colour getDrawColour(){ 
		return drawColour;
Contextual code suggestions in your IDE  Get Codota for Java