How to create a System.Drawing.Color from its hexadecimal RGB string?

Jader Dias picture Jader Dias · Dec 16, 2009 · Viewed 92.2k times · Source

I want to create a System.Drawing.Color from a value like #FF00FF or FF00FF without needing to write code for that. There is any .NET built-in parser for that?

Answer

João Angelo picture João Angelo · Dec 16, 2009
ColorTranslator.FromHtml("#FF00FF");