Java Utililty Methods Color Darker

List of utility methods to do Color Darker

Description

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

Method

Colordarker(Color c, float factor)
Returns a darker version of the given color by the given factor.
return blend(c, Color.BLACK, factor);
Colordarker(Color col, double FACTOR)
Makes the color darker
return getColor(Math.max((int) (col.getRed() * FACTOR), 0), Math.max((int) (col.getGreen() * FACTOR), 0),
        Math.max((int) (col.getBlue() * FACTOR), 0));
Colordarker(Color color)
Creates a new Color that is a darker version of the specified Color.
return darker(color, 0.251f);
Colordarker(Color color)
Darken a color.
if (color.equals(Color.white))
    return WHITE_DARKER;
else if (color.equals(Color.black))
    return BLACK_DARKER;
else
    return color.darker();
Colordarker(Color color, double factor)
Get darker color
if (factor < 0.0)
    factor = 0.7;
else if (factor > 1.0)
    factor = 0.7;
return new Color(Math.max((int) (color.getRed() * factor), 0),
        Math.max((int) (color.getGreen() * factor), 0), Math.max((int) (color.getBlue() * factor), 0));
Colordarker(Color color, double fraction)
Make a color darker.
int red = (int) Math.round(color.getRed() * (1.0 - fraction));
int green = (int) Math.round(color.getGreen() * (1.0 - fraction));
int blue = (int) Math.round(color.getBlue() * (1.0 - fraction));
return new Color(normalize(red), normalize(green), normalize(blue), color.getAlpha());
Colordarker(Color color, float fraction)
Make a color darker.
float factor = (1.0f - fraction);
int rgb = color.getRGB();
int red = (rgb >> 16) & 0xFF;
int green = (rgb >> 8) & 0xFF;
int blue = (rgb >> 0) & 0xFF;
int alpha = (rgb >> 24) & 0xFF;
red = (int) (red * factor);
green = (int) (green * factor);
...
Colordarker(Color color, float ratio)
Make a color darker.
return mergeColors(Color.BLACK, ratio, color, 1 - ratio);
Colordarker(final Color color, final int rgbOffset)
Returns a darker version of the given color.
if (color == null)
    throw new IllegalArgumentException("Parameter 'color' must not be null!");
final int red = Math.max(color.getRed() - rgbOffset, 0);
final int green = Math.max(color.getGreen() - rgbOffset, 0);
final int blue = Math.max(color.getBlue() - rgbOffset, 0);
return new Color(red, green, blue, color.getAlpha());
Colordarker(final Color color, float factor)
Create a darker color using a factor.
return new Color(Math.max((int) (color.getRed() * factor), 0),
        Math.max((int) (color.getGreen() * factor), 0), Math.max((int) (color.getBlue() * factor), 0));