Here you can find the source of invert(Color color)
public static Color invert(Color color)
//package com.java2s; //License from project: Open Source License import java.awt.Color; public class Main { public static Color invert(Color color) { float[] rgb = color.getRGBComponents(null); return new Color(1.0f - rgb[0], 1.0f - rgb[1], 1.0f - rgb[2]); }/* w ww. j a va 2 s.c om*/ }