Hi Pravesh Singh, You 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");
Liked By
Write Answer
how to convert html color to rgb in c#?
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy
Join MindStick Community
You have need login or register for voting of answers or question.
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");