Convert .Net Color Objects to HEX codes and Back

Posted by Damien on Stack Overflow See other posts from Stack Overflow or by Damien
Published on 2009-06-11T16:05:36Z Indexed on 2010/03/23 14:33 UTC
Read the original article Hit count: 358

Filed under:
|
|
|

As per the question title, How could I take a hex code and convert it to a .Net Color object, and do it the other way?

I googled and keep getting the same way which doesn't work.

 ColorTranslator.ToHtml(renderedChart.ForeColor)

Which returns the name of the color as in 'White' instead of '#ffffff'! Doing it the other way seems to have odd results, only working some of the time...

© Stack Overflow or respective owner

Related posts about color

Related posts about .NET