I'm trying to use a hex colour (#E32017
) programmatically for text within a textblock but it's not working. Does anyone know how a hex colour can used instead of Colors.Red
when it comes to textblocks for Windows Phone?
TextBlock textBlock = new TextBlock();
textBlock.Inlines.Add(new Run { Text = "H", Foreground = new SolidColorBrush(Colors.Red) });
You can call the Color.FromArgb method and specify the individual red, green, and blue components of your color: