Chris Pietschmann

husband, father, hacker, entrepreneur, futurist, innovator, autodidact

NAVIGATION - SEARCH

C# .NET: Convert System.Drawing.Color to HTML color

Here is a small example of how to convert a System.Drawing.Color to the HTML color format (Hex value or HTML color name value) and back.

System.Drawing.Color c = System.Drawing.ColorTranslator.FromHtml("#F5F7F8");
String strHtmlColor = System.Drawing.ColorTranslator.ToHtml(c);
blog comments powered by Disqus