Code example for ColorMatrix

Methods: setsetSaturation

0
 
		 
		switch(colorType){
			//컬러  
			case COLOR_TYPE_NORMAL:
				cm.set(new float[] { scale, 0, 0, 0, 0, 0, scale, 0, 0, 0, 0, 0, scale,
						0, 0, 0, 0, 0, 1, 0 }); 
				break; 
				 
			//흑백 
			case COLOR_TYPE_BLACK:
				cm.set(new float[] { scale, 0, 0, 0, 0, 0, scale, 0, 0, 0, 0, 0, scale,
						0, 0, 0, 0, 0, 1, 0 }); 
				cm.setSaturation(0);
				break; 
			 
			//채도 색상변경 
			case COLOR_TYPE_CHAEDO:
				cm.set(new ColorMatrix(new float[] { 0.5f, 0.5f, 0.5f, 0, 0, 0.5f,
						0.5f, 0.5f, 0, 0, 0.5f, 0.5f, 0.5f, 0, 0, 0, 0, 0, 1, 0, 0, 0, 
						0, 0, 0, 1, 0 })); 
				 cm.set(new float[] {
				 scale, 0, 0, 0, translate,
				 0, scale, 0, 0, translate,
				 0, 0, scale, 0, translate,
				 0, 0, 0, 1, 0 }); 
				break;