Wpf/Silverlight: How to convert hex value into Color? Wpf/Silverlight: How to convert hex value into Color? wpf wpf

Wpf/Silverlight: How to convert hex value into Color?


new SolidColorBrush(Color.FromArgb(0x44, 0xFF, 0xFF, 0));

(Documentation)

Note: Don't use Color.FromRgb() (without the A) if your code will be shared in both Silverlight and WPF, as the FromRgb method doesn't exist in Silverlight.


Try

(Brush)(new BrushConverter().ConvertFrom("#44FFFF00"));

much better IMHO


Try

new SolidColorBrush(Color.FromArgb(0x44FFFF00));