Java examples for 2D Graphics:Color Invert
get Inverted Color
//package com.java2s; import java.awt.*; public class Main { public static Color getInvertedColor(Color color) { return new Color(0xFFFFFF - color.getRGB()); }/*from www. j a v a 2s . co m*/ public static Color getInvertedColor(int colorCode) { return getInvertedColor(new Color(colorCode)); } }