I want to create SolidColorBrush from Hex value such as #ffaacc. How can I do this?
On MSDN, I got :
SolidColorBrush mySolidColorBrush = new SolidCol
using System.Windows.Media;
byte R = Convert.ToByte(color.Substring(1, 2), 16);
byte G = Convert.ToByte(color.Substring(3, 2), 16);
byte B = Convert.ToByte(color.Substring(5, 2), 16);
SolidColorBrush scb = new SolidColorBrush(Color.FromRgb(R, G, B));
//applying the brush to the background of the existing Button btn:
btn.Background = scb;