Here you can find the source of perceivedBrightness(Color c)
Parameter | Description |
---|---|
c | a parameter |
public static float perceivedBrightness(Color c)
//package com.java2s; import java.awt.Color; public class Main { /**/* ww w . j a v a 2s.c o m*/ * This is a color's perceived brightness by the human eye * @param c * @return brightness from 0.0 to 1.0 */ public static float perceivedBrightness(Color c) { return (c == null) ? 1.0f : ((float) (299 * c.getRed() + 587 * c.getGreen() + 114 * c.getBlue())) / 255000f; } }