Getting a .net System.Drawing color from a Hex value.

Category : ASP.Net

So I’m using a jquery color picker, got to the back code where I was going to grab my colors and thought for a minute that there was no way to convert my HEX to one of the .Net system colors… (what am I thinking, WE should always remember that there is more than likely some class available to do what you need, as was the case here!)

SO YOU got a hex and need it to convert to a system color? Here ya go:

System.Drawing.ColorTranslator.FromHtml(“#FFFFFF”);

Thank you .Net
T

Post a comment

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word