Programatically using hex color code in Silverlight

Define a utility class and use the code below public static SolidColorBrush GetColorFromHex(string myColor) { return new SolidColorBrush( Color.FromArgb( Convert.ToByte(myColor.Substring(1, 2), 16), Convert.ToByte(myColor.Substring(3, 2), 16), Convert.ToByte(myColor.Substring(5, 2), 16), Convert.ToByte(myColor.Substring(7, 2), 16) ) ); } Call this method from anywhere by