List of utility methods to do Color Lighten
Color | lighter(Color clr) lighter float[] hsb = new float[3]; Color.RGBtoHSB(clr.getRed(), clr.getGreen(), clr.getBlue(), hsb); hsb[1] *= 0.4; return Color.getHSBColor(hsb[0], hsb[1], hsb[2]); |
Color | lighter(Color clr, double saturationFraction) lighter float[] hsb = new float[3]; Color.RGBtoHSB(clr.getRed(), clr.getGreen(), clr.getBlue(), hsb); hsb[1] *= saturationFraction; return Color.getHSBColor(hsb[0], hsb[1], hsb[2]); |
Color | lighter(Color color, double fraction) Make a color lighter. 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()); |
Color | lighter(Color color, float ratio) Make a color lighter. return mergeColors(Color.WHITE, ratio, color, 1 - ratio);
|
Color | lighter(final Color color, final int rgbOffset) Returns a lighter version of the given color. if (color == null) throw new IllegalArgumentException("Parameter 'color' must not be null!"); final int red = Math.min(color.getRed() + rgbOffset, 255); final int green = Math.min(color.getGreen() + rgbOffset, 255); final int blue = Math.min(color.getBlue() + rgbOffset, 255); return new Color(red, green, blue, color.getAlpha()); |
Color | lighter(final Color color, float factor) Create a lighter 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)); |
Color | lighterColor(Color c, double amount) lighter Color return darkerColor(c, -amount);
|
Color | lighterColor(Color lineColor, int adj) lighter Color int r = Math.max(0, Math.min(255, lineColor.getRed() + adj)); int g = Math.max(0, Math.min(255, lineColor.getGreen() + adj)); int b = Math.max(0, Math.min(255, lineColor.getBlue() + adj)); return new Color(r, g, b, lineColor.getAlpha()); |