For example:
blue
converts to:
#0000FF
I wrote it as:
Color color = Color.FromName("blue");
But I don't know how to get the hexadecimal representation.
You're half way there. Use .ToArgb to convert it to it's numberical value, then format it as a hex value.
.ToArgb
int ColorValue = Color.FromName("blue").ToArgb(); string ColorHex = string.Format("{0:x6}", ColorValue);
1.4m articles
1.4m replys
5 comments
57.0k users