For Programmers: Free Programming Magazines  


Home > Archive > ASP .NET > December 2004 > Converting RGB to Hex?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Converting RGB to Hex?
Lars Netzel

2004-12-31, 8:56 am

Hello!

I'm creating a servercontrol where you can set a Color property in the
design view. This is going into a STYLE attribut in the rendered HTML code
and I need to convert it to a HEX value... how do I do this?

The only thing I can find is the Color.ToArgb and that is not working for
me.

Best Regards/
Lars Netzel


Chance Hopkins

2004-12-31, 8:56 am

Just off the top of my head I think it's Color.FromName("#000000") or
something like that (maybe no #).

"Lars Netzel" <troligt@apa.se> wrote in message
news:u5sljoy7EHA.2452@TK2MSFTNGP14.phx.gbl...
> Hello!
>
> I'm creating a servercontrol where you can set a Color property in the
> design view. This is going into a STYLE attribut in the rendered HTML code
> and I need to convert it to a HEX value... how do I do this?
>
> The only thing I can find is the Color.ToArgb and that is not working for
> me.
>
> Best Regards/
> Lars Netzel
>



Lars Netzel

2004-12-31, 3:57 pm

No actually it was a ColorTranslator

'this create a HEX value for the web from a Color
ColorTranslator.ToHtml(Me.BackColor)

best Regards
/Lars


"Chance Hopkins" <chance_hopkins@hotmail.com> skrev i meddelandet
news:eH9fSty7EHA.1404@TK2MSFTNGP11.phx.gbl...
> Just off the top of my head I think it's Color.FromName("#000000") or
> something like that (maybe no #).
>
> "Lars Netzel" <troligt@apa.se> wrote in message
> news:u5sljoy7EHA.2452@TK2MSFTNGP14.phx.gbl...
>
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com