How can I get a color from a hexadecimal color code (e.g. #FFDFD991
)?
I am reading a file and am getting a hexadecimal color code. I need to create the
The three variants below give exactly the same color. The last one has the benefit of being highlighted in the Visual Studio 2010 IDE (maybe it's ReSharper that's doing it) with proper color.
var cc1 = System.Drawing.ColorTranslator.FromHtml("#479DEE");
var cc2 = System.Drawing.Color.FromArgb(0x479DEE);
var cc3 = System.Drawing.Color.FromArgb(0x47, 0x9D, 0xEE);