private Color getColorForEntropy ( double entropy ) { assert entropy <= 1 ; assert entropy >= 0 ; Color entropyColor = colorMap . get ( ENTROPY ) ; float [ ] hsbvals = new float [ 3 ] ; Color . RGBtoHSB ( entropyColor . getRed ( ) , entropyColor . getGreen ( ) , entropyColor . getBlue ( ) , hsbvals ) ; float entropyHue = hsbvals [ 0 ] ; float saturation = hsbvals [ 1 ] ; float brightness = ( float ) entropy ; return Color . getHSBColor ( entropyHue , saturation , brightness ) ; // int col = (int) (entropy * 255); // return new Color(col, col, col); }
Creates a color instance based on a given entropy .