Sponsored By
DataConverter
Advertise with Us
Advertisement
Advertise with Us
Follow Us
Follow _MindStick_ on Twitter View MindStick Software's LinkedIn profile View MindStick Software's Facebook profile
Mindstick
Article Article  Forum Forum  Blog Blog  Quiz Quiz  Beginner Beginner  Careers Careers  Contact Contact  Login Login  
Home | Product | Services | About Us | Interview | DeveloperSection | Submit an Article | Submit Blog
Report Abuse Form
Reason:    
   

Home >> .Net >> C# >> how to convert html color to rgb in c#?
Author Post

Pravesh Singh


Total Post: 46
Member Since: 12/12/2011
Points: 238
how to convert html color to rgb in c#?
Posted On: 7/16/2012 4:32:14 AM

Hi,

Can anyone tell me how to convert html color to rgb in c#. Please give the code if possible.

Author Post

Arun Singh


Total Post: 49
Member Since: 7/1/2011
Points: 338
Re: how to convert html color to rgb in c#?
Posted On: 7/21/2012 1:28:23 AM
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");
Report Abuse Form
Reason:    
 
Total Online Users: 7212
Advertisement
MindStick DataConverter
Advertise with Us
  
Copyright © 2013MindStick. All Rights Reserved.