how to convert html color to rgb in c#? Pravesh Singh677916-Jul-2012Hi,Can anyone tell me how to convert html color to rgb in c#. Please give the code if possible.c#c# Updated on 21-Jul-2012
Anonymous User
21-Jul-2012You can use this code to resolve your problem....
using System.Drawing;
using System;
//convert to the HTML color value of a known System.Drawing.Color
string htmlNamedColorValue = ColorTranslator.ToHtml(Color.Crimson);
//convert to System.Drawing.Color from HTML hex color value
Color colorValueFrmHex = ColorTranslator.FromHtml("#FFFF33");
//convert to System.Drawing.Color from HTML known color
Color colorValue = ColorTranslator.FromHtml("DarkRed");