public static float colorToFloat(final Color clr){
  return Color.RGBtoHSB(clr.getRed(),clr.getGreen(),clr.getBlue(),null)[0];
}

public static float colorToFloat ( final Color clr ) { return Color . RGBtoHSB ( clr . getRed ( ) , clr . getGreen ( ) , clr . getBlue ( ) , null ) [ 0 ] ; }
returns the hue associated with a color .
