NPlot.StepGradient.GetColor C# (CSharp) Метод

GetColor() публичный Метод

Gets a color corresponding to a number between 0.0 and 1.0 inclusive. The color will be a linear interpolation of the min and max colors.
public GetColor ( double prop ) : Color
prop double the number to get corresponding color for (between 0.0 and 1.0)
Результат Color
        public Color GetColor( double prop )
        {
            switch (stepType_)
            {
                case Type.RGB:
                {
                    if (prop < 1.0/3.0) return Color.Red;
                    if (prop < 2.0/3.0) return Color.Green;
                    return Color.Blue;
                }
                case Type.Rainbow:
                {
                    if (prop < 0.125) return Color.Red;
                    if (prop < 0.25) return Color.Orange;
                    if (prop < 0.375) return Color.Yellow;
                    if (prop < 0.5) return Color.Green;
                    if (prop < 0.625) return Color.Cyan;
                    if (prop < 0.75) return Color.Blue;
                    if (prop < 0.825) return Color.Purple;
                    return Color.Pink;
                }
                default:
                {
                    return Color.Black;
                }
            }
        }