List of utility methods to do Color Brighten
Color | brighter(Color c) brighter 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; |
Color | brighter(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], Math.min(1f, hsb[1] * 1.3f), Math.min(1f, hsb[2] * 1.05f)); |
Color | brighter(Color c, double factor) Make the color brighter by the specified factor. int r = c.getRed(); int g = c.getGreen(); int b = c.getBlue(); int i = (int) (1.0 / (1.0 - factor)); if (r == 0 && g == 0 && b == 0) { return new Color(i, i, i); if (r > 0 && r < i) ... |
Color | brighter(Color c, double p) brighter if (c == null) { return null; double r = c.getRed(); double g = c.getGreen(); double b = c.getBlue(); double rd = 255.0 - r; double gd = 255.0 - g; ... |
Color | brighter(Color col, double FACTOR) Makes the color darker return getColor(255 - (int) ((255 - col.getRed()) * FACTOR), 255 - (int) ((255 - col.getGreen()) * FACTOR), 255 - (int) ((255 - col.getBlue()) * FACTOR), 0); |
Color | brighter(Color color) Creates a new Color that is a brighter version of the specified Color .
return brighter(color, 0.251f);
|
Color | brighter(Color color) Lighten up a color. if (color.equals(Color.white)) return WHITE_BRIGHTER; else if (color.equals(Color.black)) return BLACK_BRIGHTER; else { int red = color.getRed(); red += (int) ((255 - red) * FACTOR); int blue = color.getBlue(); ... |
Color | brighter(Color color, double factor) Get brighter color if (factor < 0.0) factor = 0.7; else if (factor > 1.0) factor = 0.7; return new Color(Math.min((int) (color.getRed() / factor), 255), Math.min((int) (color.getGreen() / factor), 255), Math.min((int) (color.getBlue() / factor), 255)); |
Color | brighter(Color color, float factor) brighter if (color == null) return null; int r = color.getRed(); int g = color.getGreen(); int b = color.getBlue(); int i = (int) (1.0 / (1.0 - factor)); if (r == 0 && g == 0 && b == 0) { return Color.black; ... |
Color | brighterColor(Color c) brighter Color return factorColor(c, 1 / sFactor);
|