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

ColorgetDarker(Color color)
get Darker
float hsbVals[] = Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), null);
return Color.getHSBColor(hsbVals[0], hsbVals[1], 0.8f * hsbVals[2]);
ColorgetDarker(Color color, double factor)
get Darker
return new Color(Math.max((int) (color.getRed() * factor), 0),
        Math.max((int) (color.getGreen() * factor), 0), Math.max((int) (color.getBlue() * factor), 0));
ColorgetDarkerColor(Color color)
get Darker Color
return getScaledColor(color, DARKER_SCALE);
ColorgetDarkerColor(Color color, double diff)
Returns darker version of the specified color.
int r = (int) ((1.0 - diff) * color.getRed());
int g = (int) ((1.0 - diff) * color.getGreen());
int b = (int) ((1.0 - diff) * color.getBlue());
return new Color(r, g, b);
ColorgetDarkerLine(Color c, float alternateRowDarkerFactor)
get Darker Line
return getSafeColor((int) (c.getRed() * alternateRowDarkerFactor),
        (int) (c.getGreen() * alternateRowDarkerFactor), (int) (c.getBlue() * alternateRowDarkerFactor));
ColorgetLineDarkColor()
get Line Dark Color
return lineDarkColor;
voidinitializePattern(Color light, Color dark)
Initializes the pattern image.
pattern2D = new BufferedImage(4, 4, BufferedImage.TYPE_INT_ARGB);
lightColor = light;
darkColor = dark;
Graphics g = pattern2D.getGraphics();
g.setColor(light);
g.fillRect(0, 0, 1, 1);
g.fillRect(2, 2, 1, 1);
g.setColor(dark);
...
ColormakeDarker(final Color color, final double percentage)
make Darker
int r = Math.max(color.getRed() - (int) (color.getRed() * percentage), 0);
int g = Math.max(color.getGreen() - (int) (color.getGreen() * percentage), 0);
int b = Math.max(color.getBlue() - (int) (color.getBlue() * percentage), 0);
return new Color(r, g, b);
booleanreallyDark(Color c)
Return true if the color is really dark.
synchronized (hue_sat_bri) {
    Color.RGBtoHSB(c.getRed(), c.getGreen(), c.getBlue(), hue_sat_bri);
    return (hue_sat_bri[2] < 0.10f); 
voidsetColorsDarkTheme()
set Colors Dark Theme
wireColor = Color.WHITE;
controlPathColor = new Color(0, 170, 230);
criticalPathColor = Color.RED;
irrelevantColor = Color.GRAY;
readColor = new Color(0, 128, 0);
writeColor = new Color(128, 0, 0);
rwColor = new Color(128, 128, 0);
instColor = new Color(110, 110, 110);
...