Here you can find the source of invert(Color color)
Parameter | Description |
---|---|
color | The color to invert. |
public static Color invert(Color color)
//package com.java2s; //License from project: Open Source License import java.awt.Color; public class Main { /**/*from ww w . ja v a 2s.c o m*/ * Inverts a color channel by channel. * @param color The color to invert. * @return The inverted color. */ public static Color invert(Color color) { return new Color(255 - color.getRed(), 255 - color.getGreen(), 255 - color.getBlue()); } }