Java examples for 2D Graphics:Color Light
get Color Brightness
//package com.java2s; import java.awt.Color; public class Main { public static double getBrightness(Color c) { return Math.sqrt(getNorm(c)); }/*from w w w .j a v a2 s . c om*/ public static double getNorm(Color c) { return (c.getRed() * c.getRed() + c.getGreen() * c.getGreen() + c .getBlue() * c.getBlue()); } }