Convert HTML color to System.Drawing.Color

Ok so I have an HTML color I need to use in an web app. Problem is most of the controls use System.Drawing.Color. So I can't just go

TextControl.BackColor = "FFFFFF";

or whatever you have to convert the HTML to a System.Drawing.Color like so:

TextControl.BackColor = System.Drawing.ColorTranslator.FromHtml("FFFFFF");

And voila! HTML colors are now System.Drawing.Colors


Popular Posts