I am working on a windows phone game, and I got stuck when I wanted to convert a HEX string into Color. On windows phone 8 silverlight it is not a problem but I cannot find a so
generete a file namely: ColorUtils.cs
using Windows.UI.Xaml.Markup;
....
static class ColorUtils
{
public static Color GetColorFromHex(string hexString)
{
Color x =(Color)XamlBindingHelper.ConvertValue(typeof(Color), hexString);
return x;
}
}
and use it something like
var acolor=(new SolidColorBrush(ColorUtils.GetColorFromHex("#F24C27")):
or with alpha
var acolor=(new SolidColorBrush(ColorUtils.GetColorFromHex("#4CF24C27")):