Java Color Invert invert(Color colour)

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

Description

invert

License

Open Source License

Declaration

public static Color invert(Color colour) 

Method Source Code


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

import java.awt.Color;

public class Main {
    public static final int MAX_RGB_COMPONENT_VALUE = 255;

    public static Color invert(Color colour) {
        return new Color(MAX_RGB_COMPONENT_VALUE - colour.getRed(), MAX_RGB_COMPONENT_VALUE - colour.getGreen(),
                MAX_RGB_COMPONENT_VALUE - colour.getBlue());
    }// w w w  . ja  va 2  s .  c  o m
}

Related

  1. invert(Color c)
  2. invert(Color color)
  3. invert(Color color)
  4. invert(Color color)
  5. invertColor(Color c)
  6. invertColor(Color cColor)
  7. invertColor(int color)
  8. invertColor(int color)