import java.awt.Color; /* * Created on 21-Jul-2005 * * TODO To change the template for this generated file go to * Window - Preferences - Java - Code Style - Code Templates */ /** * @author Christian * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ class Colore { String name; int value; int count; float hue; float sat; float bri; Colore(String $name){ name=$name; count=0; value=Integer.parseInt(name,16); calculateHUE(); } void increaseCount(){ //System.out.print("+"); count++; } void calculateHUE(){ int c=value; float hsb[]=Color.RGBtoHSB( c>>16&0xff, c>>8&0xff, c&0xff, null ); hue=hsb[0]; sat=hsb[1]; bri=hsb[2]; } }