Mega Code Archive

 
Categories / C# / 2D Graphics
 

Color to RGB value

using System; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Ink; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using System.Reflection; internal class Utility {     static public string ColorToRGB(Color c)     {         SolidColorBrush s = new SolidColorBrush(c);         return "#" + s.Color.R.ToString("x2") + s.Color.G.ToString("x2") + s.Color.B.ToString("x2");     } }