Converting RGB to Hex?

  • Thread starter Thread starter Lars Netzel
  • Start date Start date
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
 
Just off the top of my head I think it's Color.FromName("#000000") or
something like that (maybe no #).
 
No actually it was a ColorTranslator

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

best Regards
/Lars
 
Back
Top