List of utility methods to do Color Darker
Color | darker(Color c, float factor) Returns a darker version of the given color by the given factor. return blend(c, Color.BLACK, factor);
|
Color | darker(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)); |
Color | darker(Color color) Creates a new Color that is a darker version of the specified Color .
return darker(color, 0.251f);
|
Color | darker(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(); |
Color | darker(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)); |
Color | darker(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()); |
Color | darker(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); ... |
Color | darker(Color color, float ratio) Make a color darker. return mergeColors(Color.BLACK, ratio, color, 1 - ratio);
|
Color | darker(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()); |
Color | darker(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)); |