In C#, how can I convert a Color object into a byte value?
Color
byte
For example, the color #FFF would be converted to the value 255>
#FFF
255>
Try this,
string colorcode = "#FFFFFF00"; int argb = Int32.Parse(colorcode.Replace("#", ""), NumberStyles.HexNumber); Color clr = Color.FromArgb(argb);
also see this How to get Color from Hexadecimal color code using .NET?