Java Color Invert invert(Color color)

Here you can find the source of invert(Color color)

Description

invert

License

Open Source License

Declaration

public static Color invert(Color color) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.awt.Color;

public class Main {
    public static Color invert(Color color) {
        float[] rgb = color.getRGBComponents(null);
        return new Color(1.0f - rgb[0], 1.0f - rgb[1], 1.0f - rgb[2]);
    }/* w ww. j a va  2  s.c  om*/
}

Related

  1. invert(Color c)
  2. invert(Color color)
  3. invert(Color color)
  4. invert(Color colour)
  5. invertColor(Color c)
  6. invertColor(Color cColor)