Code example for ColorMatrix

Methods: setSaturation

0
	 *            true if the grayscale should be activated. 
	 */ 
	public void setImageGrayscale(boolean greyscale) {
		this.greyscale = greyscale;
		if (greyscale) {
			ColorMatrix matrix = new ColorMatrix();
			matrix.setSaturation(0);
			imageView.setColorFilter(new ColorMatrixColorFilter(matrix));
		} else { 
			imageView.setColorFilter(null);
		} 
	} 
 
	public boolean isOpacity() { 
		return opacity;
	} 
 
	public boolean isGreyscale() { 
		return greyscale;
	} 
Stop searching for code, let great code find you!  Add Codota to your java IDE