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
If you want to do it with a Windows Store App, following by @Hans Kesting and @Jink answer:
string colorcode = "#FFEEDDCC";
int argb = Int32.Parse(colorcode.Replace("#", ""), NumberStyles.HexNumber);
tData.DefaultData = Color.FromArgb((byte)((argb & -16777216) >> 0x18),
(byte)((argb & 0xff0000) >> 0x10),
(byte)((argb & 0xff00) >> 8),
(byte)(argb & 0xff));