Here you can find the source of invertColor(Color cColor)
public static Color invertColor(Color cColor)
//package com.java2s; /** Copyright by Barry G. Becker, 2000-2011. Licensed under MIT License: http://www.opensource.org/licenses/MIT */ import java.awt.*; public class Main { public static Color invertColor(Color cColor) { return invertColor(cColor, 255); }//from w w w. j a v a2 s . c om public static Color invertColor(Color cColor, int trans) { return new Color(255 - cColor.getRed(), 255 - cColor.getGreen(), 255 - cColor.getBlue(), trans); } }