Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > standard way of getting color # string from drawing.color?

Reply
Thread Tools

standard way of getting color # string from drawing.color?

 
 
PJ6
Guest
Posts: n/a
 
      09-15-2005
I can't find any built-in way to do this. I'm assigning an HTML cell a
bgcolor and want to do it from a real color FromArgb... how do I get the #
string to assign it to the HTML cell? Or do I have to code a translator up
myself?

TIA,
Paul


 
Reply With Quote
 
 
 
 
S. Justin Gengo
Guest
Posts: n/a
 
      09-15-2005
Paul,

System.Drawing.Color.FromArgb([argb color here])


--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"PJ6" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I can't find any built-in way to do this. I'm assigning an HTML cell a
>bgcolor and want to do it from a real color FromArgb... how do I get the #
>string to assign it to the HTML cell? Or do I have to code a translator up
>myself?
>
> TIA,
> Paul
>



 
Reply With Quote
 
 
 
 
S. Justin Gengo
Guest
Posts: n/a
 
      09-15-2005
Paul,

I was re-reading and realized that you may have also meant you want the full
conversion to a html table cell color. That's like this:

Dim ColorTranslator As System.Drawing.ColorTranslator

Dim HtmlColor As String = ColorTranslator.ToHtml(System.Drawing.Color.Red)

If you are using a server side control for your table. Then you'll be able
to assign the color with the method I showed you previously. If you want the
actual RGB color (i.e. #FFFFFF) Then that's the code above.


--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"S. Justin Gengo" <sjgengo@[no_spam_please]aboutfortunate.com> wrote in
message news:(E-Mail Removed)...
> Paul,
>
> System.Drawing.Color.FromArgb([argb color here])
>
>
> --
> Sincerely,
>
> S. Justin Gengo, MCP
> Web Developer / Programmer
>
> www.aboutfortunate.com
>
> "Out of chaos comes order."
> Nietzsche
> "PJ6" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>I can't find any built-in way to do this. I'm assigning an HTML cell a
>>bgcolor and want to do it from a real color FromArgb... how do I get the #
>>string to assign it to the HTML cell? Or do I have to code a translator up
>>myself?
>>
>> TIA,
>> Paul
>>

>
>



 
Reply With Quote
 
PJ6
Guest
Posts: n/a
 
      09-15-2005
Why don't you read my question again.

Paul

"S. Justin Gengo" <sjgengo@[no_spam_please]aboutfortunate.com> wrote in
message news:(E-Mail Removed)...
> Paul,
>
> System.Drawing.Color.FromArgb([argb color here])
>
>
> --
> Sincerely,
>
> S. Justin Gengo, MCP
> Web Developer / Programmer
>
> www.aboutfortunate.com
>
> "Out of chaos comes order."
> Nietzsche
> "PJ6" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>I can't find any built-in way to do this. I'm assigning an HTML cell a
>>bgcolor and want to do it from a real color FromArgb... how do I get the #
>>string to assign it to the HTML cell? Or do I have to code a translator up
>>myself?
>>
>> TIA,
>> Paul
>>

>
>



 
Reply With Quote
 
PJ6
Guest
Posts: n/a
 
      09-15-2005
Aha! I knew there was something built in.

Thanks,
Paul

"S. Justin Gengo" <sjgengo@[no_spam_please]aboutfortunate.com> wrote in
message news:(E-Mail Removed)...
> Paul,
>
> I was re-reading and realized that you may have also meant you want the
> full conversion to a html table cell color. That's like this:
>
> Dim ColorTranslator As System.Drawing.ColorTranslator
>
> Dim HtmlColor As String = ColorTranslator.ToHtml(System.Drawing.Color.Red)
>
> If you are using a server side control for your table. Then you'll be able
> to assign the color with the method I showed you previously. If you want
> the actual RGB color (i.e. #FFFFFF) Then that's the code above.
>
>
> --
> Sincerely,
>
> S. Justin Gengo, MCP
> Web Developer / Programmer
>
> www.aboutfortunate.com
>
> "Out of chaos comes order."
> Nietzsche
> "S. Justin Gengo" <sjgengo@[no_spam_please]aboutfortunate.com> wrote in
> message news:(E-Mail Removed)...
>> Paul,
>>
>> System.Drawing.Color.FromArgb([argb color here])
>>
>>
>> --
>> Sincerely,
>>
>> S. Justin Gengo, MCP
>> Web Developer / Programmer
>>
>> www.aboutfortunate.com
>>
>> "Out of chaos comes order."
>> Nietzsche
>> "PJ6" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>>I can't find any built-in way to do this. I'm assigning an HTML cell a
>>>bgcolor and want to do it from a real color FromArgb... how do I get the
>>># string to assign it to the HTML cell? Or do I have to code a translator
>>>up myself?
>>>
>>> TIA,
>>> Paul
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the standard way to put a standard set of asserts into acalled subroutine in test/unit? Xeno Campanoli / Eskimo North and Gmail Ruby 2 05-05-2010 10:44 PM
Changing font color from current font color to black color Kamaljeet Saini Ruby 0 02-13-2009 04:58 PM
Ordinal Date String to Standard Date String for a Beginner davyb Ruby 7 11-18-2005 08:54 PM
How standard is the standard library? steve.leach Python 1 04-18-2005 04:07 PM
printed color way off from screen color Keith Wiley Digital Photography 5 08-25-2003 05:13 PM



Advertisments