Search This Blog

Thursday, November 7, 2013

Convert color to html color C#

C# > Color

ColorTranslator.ToHtml translates the specified Color structure to an HTML string color.

Example:

Color cl = Color.FromArgb(0, 99, 148);
string htmlColor = ColorTranslator.ToHtml(cl);