invert Color - Java 2D Graphics

Java examples for 2D Graphics:Color Invert

Description

invert Color

Demo Code


//package com.java2s;
import java.awt.*;

public class Main {
    public static Color invertColor(Color c) {
        return new Color(255 - c.getRed(), 255 - c.getGreen(),
                255 - c.getBlue());/*  www  . jav  a2s.c o m*/
    }
}

Related Tutorials