List of utility methods to do Color Invert
Color | invert(Color c) invert int a = c.getAlpha(); int r = MAX_RGB_VALUE - c.getRed(); int g = MAX_RGB_VALUE - c.getGreen(); int b = MAX_RGB_VALUE - c.getBlue(); if ((r + g + b > 740) || (r + g + b < 20)) { return new Color(MAX_RGB_VALUE, MAX_RGB_VALUE, 40, a); } else { return new Color(r, g, b, a); ... |
Color | invert(Color color) Inverts a color channel by channel. return new Color(255 - color.getRed(), 255 - color.getGreen(), 255 - color.getBlue()); |
Color | invert(Color color) invert float[] rgb = color.getRGBComponents(null); return new Color(1.0f - rgb[0], 1.0f - rgb[1], 1.0f - rgb[2]); |
Color | invert(Color color) invert return new Color(255 - color.getRed(), 255 - color.getGreen(), 255 - color.getBlue()); |
Color | invert(Color colour) invert return new Color(MAX_RGB_COMPONENT_VALUE - colour.getRed(), MAX_RGB_COMPONENT_VALUE - colour.getGreen(), MAX_RGB_COMPONENT_VALUE - colour.getBlue()); |
Color | invertColor(Color c) invert Color return new Color(255 - c.getRed(), 255 - c.getGreen(), 255 - c.getBlue()); |
Color | invertColor(Color cColor) invert Color return invertColor(cColor, 255);
|
int | invertColor(int color) Invert the color int a = (color >> 24) & 0xff; int r = (color >> 16) & 0xff; int g = (color >> 8) & 0xff; int b = color & 0xff; r = 255 - r; g = 255 - g; b = 255 - b; return toRGB(r, g, b, a); ... |
int | invertColor(int color) invert Color int red = getRed(color); int green = getGreen(color); int blue = getBlue(color); red = 0xff - red; green = 0xff - green; blue = 0xff - blue; return getColor(red, green, blue); |
int | invertColor(int color) Inverts color parsed as integer Color origColor = new Color(color); int invertedRed = ((255 - origColor.getRed()) * 65536); int invertedGreen = ((255 - origColor.getGreen()) * 256); int invertedBlue = ((255 - origColor.getBlue())); return invertedRed + invertedGreen + invertedBlue; |