Click here to Skip to main content
15,883,901 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Actually i'm using color extender to pick the color in asp.net...but while i'm picking the color it generate the hex decimal values....but i need only rgb values...Pls any one guide me....
Posted

Try this I hope It will help you

How to convert Hexadecimal Color to RGB color (24 Bit)[^].

keep smiling :):):) haapy coding:)
 
Share this answer
 
v2
Have a look at this link:

http://snipplr.com/view/13358/[^]
 
Share this answer
 
Why have you posted this question when you have already been given the answer in the C# forum? Please post in one place only, and do not spam the forums.
 
Share this answer
 
Comments
Deenuji 7-Dec-12 7:07am    
k sir....hereafter i won't do like this...
Solution:

Write this coding in button or whatever...

System.Drawing.Color MyColor = System.Drawing.Color.FromArgb(val);
 
Share this answer
 
C#
string hex = "0x333366";
int r = Convert.ToInt32(hex.Substring(2,2),16);
int g = Convert.ToInt32(hex.Substring(4,2),16);
int p = Convert.ToInt32(hex.Substring(6,2),16);


--SJ
 
Share this answer
 
Comments
Deenuji 7-Dec-12 5:51am    
Error:A field initializer cannot reference the non-static field, method, or property 'aj._Default.hex'
codeninja-C# 7-Dec-12 6:10am    
Sorry, I don't get you
Deenuji 7-Dec-12 7:10am    
if i using ur code means i got above error...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900