Converting RGB to Hex?

L

Lars Netzel

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
 
C

Chance Hopkins

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

Lars Netzel

No actually it was a ColorTranslator

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

best Regards
/Lars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top