Here you can find the source of invert(Color colour)
public static Color invert(Color colour)
//package com.java2s; //License from project: Open Source License import java.awt.Color; public class Main { public static final int MAX_RGB_COMPONENT_VALUE = 255; public static Color invert(Color colour) { return new Color(MAX_RGB_COMPONENT_VALUE - colour.getRed(), MAX_RGB_COMPONENT_VALUE - colour.getGreen(), MAX_RGB_COMPONENT_VALUE - colour.getBlue()); }// w w w . ja va 2 s . c o m }