Java Utililty Methods Color Inverse

List of utility methods to do Color Inverse

Description

The list of methods to do Color Inverse are organized into topic(s).

Method

voidfillInverseHorGradient(Graphics g, Color[] colors, int x, int y, int w, int h)
fill Inverse Hor Gradient
int steps = colors.length;
double dy = (double) h / (double) steps;
if (dy <= 3.001) {
    int y1 = y;
    for (int i = 0; i < steps; i++) {
        int y2 = y + (int) Math.round((double) i * dy);
        g.setColor(colors[colors.length - i - 1]);
        if (i == (steps - 1)) {
...
Colorinverse(Color c)
inverse
float rgb[] = new float[3];
c.getColorComponents(rgb);
Color color = new Color(1f - rgb[0], 1f - rgb[1], 1f - rgb[2]);
return color;
Colorinverse(Color color)
Returns the inverse of a color, preserving the opacity.
return new Color(0xFF - color.getRed(), 0xFF - color.getGreen(), 0xFF - color.getBlue(), color.getAlpha());