Esempio n. 1
0
    public Color temperatureColor(float temperature)
    {
        HSVColor magenta = new HSVColor(0.90f, 1, 1);
        HSVColor red     = new HSVColor(0, 1, 1);
        float    t       = MyMath.remap(temperature, min, max, 0, 1.166f);

        if (t >= 0.166f)
        {
            return(HSVColor.lerpHue(magenta, red, t - 0.166f).toRGB());
        }
        else
        {
            return(Color.Lerp(Color.white, magenta.toRGB(), t / 0.166f));
        }
    }