List of utility methods to do Color Brighten
int | getBrightness(Color c) Returns a value between 0 and 255 where 0 is darkest and 255 is brightest return (int) Math.sqrt(c.getRed() * c.getRed() * .241 + c.getGreen() * c.getGreen() * .691 + c.getBlue() * c.getBlue() * .068); |
int | getBrightness(Color color) Compute a brightness value. return (color.getRed() * 299 + color.getGreen() * 578 + color.getBlue() * 114) / 1000;
|
int | getBrightness(Color color) Obtiene un valor entre 0 y 255 que indica el brillo de un Color .
return (int) Math.sqrt(color.getRed() * color.getRed() * 0.241D + color.getGreen() * color.getGreen() * 0.691D + color.getBlue() * color.getBlue() * 0.068D); |
int | getBrightness(Color color) Uses the method described at http://alienryderflex.com/hsp.html to get the perceived brightness of a color. final double cr = 0.241; final double cg = 0.691; final double cb = 0.068; double r, g, b; r = color.getRed(); g = color.getGreen(); b = color.getBlue(); double result = Math.sqrt(cr * r * r + cg * g * g + cb * b * b); ... |
float | getBrightness(int red, int green, int blue) get Brightness double cMax = (red > green) ? red : green; if (cMax < blue) cMax = blue; return ((float) cMax / (float) MAX_RGB_COMPONENT_VALUE); |
float | getBrightness(java.awt.Color color) get Brightness synchronized (s_hsbBuffer) { java.awt.Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), s_hsbBuffer); return s_hsbBuffer[2]; |
Color[] | getGradientBrightColors(Color baseColor, float step, float max) get Gradient Bright Colors List<Color> list = new ArrayList<Color>(); float color[] = Color.RGBtoHSB(baseColor.getRed(), baseColor.getGreen(), baseColor.getBlue(), null); list.add(baseColor); for (; (color[2] += step) < (max);) { list.add(Color.getHSBColor(color[0], color[1], color[2])); return list.toArray(new Color[] {}); |
Color | getRandomBrightColor() get Random Bright Color final Color mix = Color.WHITE; final Random random = new Random(); int red = random.nextInt(256); int green = random.nextInt(256); int blue = random.nextInt(256); if (mix != null) { red = (red + mix.getRed()) / 2; green = (green + mix.getGreen()) / 2; ... |
Color | getSlightlyBrighter(Color color) Computes and returns a Color that is slightly brighter than the specified Color. return getSlightlyBrighter(color, 1.1f);
|
Color | getSlightlyBrighter(Color color) get Slightly Brighter return getSlightlyBrighter(color, 1.1F);
|