user1531040 user1531040 - 2 years ago 141
ASP.NET (C#) Question

How to convert Hexadecimal #FFFFFF to System.Drawing.Color

Possible Duplicate:

How to get Color from Hex color code using .NET?

I want to convert a string like
. How do you do that?

Answer Source
string hex = "#FFFFFF";
Color _color = System.Drawing.ColorTranslator.FromHtml(hex);

Note: the hash is important!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download