BooksGrid.App/Utilities/RgbGradientGenerator.cs
/// <summary>
/// Returns the color in the range
/// 0% is green
/// 100% is red
/// </summary>
/// <param name="percent">Percent of the range</param>
/// <returns>Color from percent</returns>
Returns the color in the range
0% is green
100% is red
Returns the color in the range 0% is green 100% is red
public Color GetColorFromPercent(double percent)
        {
            int red = (int)Math.Round(255 * percent);
            int green = 127 - (int)Math.Round(127 * percent);
            int blue = 0;
            return Color.FromArgb(red, green, blue);
        }
public Color GetColorFromPercent ( double percent ) { int red = ( int ) Math . Round ( 255 * percent ) ; int green = 127 - ( int ) Math . Round ( 127 * percent ) ; int blue = 0 ; return Color . FromArgb ( red , green , blue ) ; }
Returns the color in the range
0% is green
100% is red
Returns the color in the range 0% is green 100% is red
Color from percent
Color from percent
percent
double
Percent of the range
Percent of the range