Mega Code Archive

 
Categories / C# / 2D Graphics
 

Create Color Object from RGB value

using System; using System.Collections.Generic; using System.Windows.Media; using System.Reflection; using System.Globalization; namespace NASA.BeAMartian.Utils {     public class ColorUtils     {         public static Color GetRgb(double r, double g, double b)         {             return Color.FromArgb(255, (byte)(r * 255.0), (byte)(g * 255.0), (byte)(b * 255.0));         }     } }