Java examples for 2D Graphics:Color Light
is Bright color among two Color value
//package com.java2s; import java.awt.Color; public class Main { public static boolean isBright(Color interestColor, Color comparedColor) { return getNorm(interestColor) > getNorm(comparedColor); }/*from w w w .ja va 2 s . co m*/ public static double getNorm(Color c) { return (c.getRed() * c.getRed() + c.getGreen() * c.getGreen() + c .getBlue() * c.getBlue()); } }