Code example for AvoidXfermode

		// 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 
		// mb should now have transparent pixels where they were red before 
		return mb;
	public int getDrawWidth(){ 
		return drawWidth;
	public Colour getDrawColour(){ 
		return drawColour;
Stop searching for code, let great code find you!  Add Codota to your java IDE