Java Color Invert invertColor(Color cColor)

Here you can find the source of invertColor(Color cColor)

Description

invert Color

License

MIT License

Declaration

public static Color invertColor(Color cColor) 

Method Source Code

//package com.java2s;
/** Copyright by Barry G. Becker, 2000-2011. Licensed under MIT License: http://www.opensource.org/licenses/MIT  */

import java.awt.*;

public class Main {
    public static Color invertColor(Color cColor) {
        return invertColor(cColor, 255);
    }//from w  w w. j a v  a2  s .  c  om

    public static Color invertColor(Color cColor, int trans) {
        return new Color(255 - cColor.getRed(), 255 - cColor.getGreen(), 255 - cColor.getBlue(), trans);
    }
}

Related

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