IT Community - Software Programming, Web Development and Technical Support

How to convert Color to it's corresponding Hexadecimal value?

This is a discussion on How to convert Color to it's corresponding Hexadecimal value? within the ASP and ASP.NET Programming forums, part of the Web Development category; How to convert Color to it's corresponding Hexadecimal value?...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > ASP and ASP.NET Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 09-19-2007, 10:14 PM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 882
kingmaker is on a distinguished road
Send a message via Yahoo to kingmaker
Question How to convert Color to it's corresponding Hexadecimal value?

How to convert Color to it's corresponding Hexadecimal value?
__________________
The KINGMAKER
Makes Every Thing Possible

Stuffs (My Blog)
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-28-2007, 11:40 PM
KiruthikaSambandam KiruthikaSambandam is offline
D-Web Analyst
 
Join Date: Aug 2007
Posts: 332
KiruthikaSambandam is on a distinguished road
Default Re: How to convert Color to it's corresponding Hexadecimal value?

Hi

You can try filowing sample Code for convert color to Hexadecimal value

VB.NET

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Response.Write(ToHexColor(Color.Blue))
End Sub

Function ToHexColor(ByVal c As Color) As String
Return "#" + c.ToArgb().ToString("x").Substring(2)
End Function


C#


private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
Response.Write(ToHexColor(Color.Blue));
}
string ToHexColor(Color c )
{
return "#" + c.ToArgb().ToString("x").Substring(2);
}

thanks
Kiruthika
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
To change the BackGround Color of Submenus without using CSS kingmaker HTML, CSS and Javascript Coding Techniques 1 01-20-2008 09:20 PM
Open color picker And choosing,applying a color to a Movie Clip in Flash oxygen Flash Actionscript Programming 1 07-25-2007 05:00 AM
How to convert hexadecimal value to rgb value in flash? kingmaker Flash Actionscript Programming 1 07-24-2007 06:01 AM
How can i convert integers to binary or hexadecimal? prasath C and C++ Programming 1 07-20-2007 07:31 AM
Color scheme spid4r HTML, CSS and Javascript Coding Techniques 0 03-08-2007 11:08 PM


All times are GMT -7. The time now is 03:30 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0