NPlot.LinearGradient.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 )
        {
            if (Double.IsNaN(prop))
            {
                return voidColor_;
            }

            if ( prop <= 0.0 )
            {
                return this.MinColor;
            }

            if ( prop >= 1.0 )
            {
                return this.MaxColor;
            }

            byte r = (byte)((int)(this.MinColor.R) + (int)(((double)this.MaxColor.R - (double)this.MinColor.R)*prop));
            byte g = (byte)((int)(this.MinColor.G) + (int)(((double)this.MaxColor.G - (double)this.MinColor.G)*prop));
            byte b = (byte)((int)(this.MinColor.B) + (int)(((double)this.MaxColor.B - (double)this.MinColor.B)*prop));

            return Color.FromArgb(r,g,b);
        }