Exemple #1
0
        public Color getColor(double val, double max)
        {
            Color c = new Color();

            c = RGBHSL.SetBrightness(c, 0.7);
            c = RGBHSL.SetSaturation(c, 0.9);
            double d = val / max;

            // the 0.8 and 0.15 are adjustments to the range of the colors used
            c = RGBHSL.SetHue(c, d * 0.8 + 0.15);
            return(c);
        }
Exemple #2
0
        public Color getColorLog(double val)
        {
            Color c = new Color();

            c = RGBHSL.SetBrightness(c, 0.7);
            c = RGBHSL.SetSaturation(c, 0.9);
            double d = Math.Log(val + 0.00000000000000000000000000000001);

            // logs values will range from -100 to 1.1
            // need to convert that to a range from o-1

            d = (d + 100.0) / 200.0;

            // the 0.8 and 0.15 are adjustments to the range of the colors used
            c = RGBHSL.SetHue(c, d * 0.8 + 0.15);
            return(c);
        }