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

Colordarken(Color c, double f)
Darken a color by a given amount
return mix(c, Color.black, f);
Colordarken(Color col)
darken
float[] hsv = Color.RGBtoHSB(col.getRed(), col.getGreen(), col.getBlue(), null);
hsv[2] = hsv[2] * 0.4f;
int newCol = Color.HSBtoRGB(hsv[0], hsv[1], hsv[2]);
return new Color(newCol);
Colordarken(final Color color, final double percentage)
Returns a new color that is percentage darker than the original.
if (percentage < 0.01 || percentage > 1.00) {
    throw new IllegalArgumentException("Percentage must be between [0.01 - 1.00]");
int r = color.getRed();
int g = color.getGreen();
int b = color.getBlue();
r = (int) (r * (1.00 - percentage));
g = (int) (g * (1.00 - percentage));
...
Colordarken(final Color color, final int amount)
Darkens of the desired amount the given color.
int red = (color.getRed() - amount < 0) ? 0 : color.getRed() - amount;
int green = (color.getGreen() - amount < 0) ? 0 : color.getGreen() - amount;
int blue = (color.getBlue() - amount < 0) ? 0 : color.getBlue() - amount;
Color colorLightened = new Color(red, green, blue);
return colorLightened;
ColordarkenColor(Color color)
Inchide o culoare, scazand din fiecare componenta offset-ul standard
return darkenColor(color, OFFSET_COLOR);
Colordarker(Color c)
darker
c = new Color(Math.max((int) (c.getRed() / FACTOR), 0), Math.max((int) (c.getGreen() / FACTOR), 0),
        Math.max((int) (c.getBlue() / FACTOR), 0), c.getAlpha());
return c;
Colordarker(Color c)
This is a weaker version of Color#brighter() Uses a factor closer to 1.
float[] hsb = new float[3];
int r = c.getRed();
int g = c.getGreen();
int b = c.getBlue();
Color.RGBtoHSB(r, g, b, hsb);
return Color.getHSBColor(hsb[0], hsb[1] * 0.7f, hsb[2] * 0.95f);
Colordarker(Color c, double factor)
darker
return new Color(Math.max((int) (c.getRed() * factor), 0), Math.max((int) (c.getGreen() * factor), 0),
        Math.max((int) (c.getBlue() * factor), 0), c.getAlpha());
Colordarker(Color c, double p)
darker
if (c == null) {
    return null;
double r = c.getRed();
double g = c.getGreen();
double b = c.getBlue();
r -= (r * p) / 100.0;
g -= (g * p) / 100.0;
...
Colordarker(Color c, double p)
Creates a color that is the darker version of the color parameter c.
if (c == null) {
    return null;
double r = c.getRed();
double g = c.getGreen();
double b = c.getBlue();
r -= (r * p) / 100.0;
g -= (g * p) / 100.0;
...