How do I get the color from a hexadecimal color code using .NET?

I’m assuming that’s an ARGB code… Are you referring to System.Drawing.Color or System.Windows.Media.Color? The latter is used in WPF for example. I haven’t seen anyone mention it yet, so just in case you were looking for it:

using System.Windows.Media;

Color color = (Color)ColorConverter.ConvertFromString("#FFDFD991");

Leave a Comment