You may need to manually parse the colored string.
string colorSpec = "#ff00ffff";
byte alpha = byte.Parse(colorSpec.Substring(1,2), System.Globalization.NumberStyles.HexNumber);
byte red = byte.Parse(colorSpec.Substring(3, 2),System.Globalization.NumberStyles.HexNumber);
byte green = byte.Parse(colorSpec.Substring(5, 2), System.Globalization.NumberStyles.HexNumber);
byte blue = byte.Parse(colorSpec.Substring(7, 2), System.Globalization.NumberStyles.HexNumber);
Color fillColor = Color.FromArgb(alpha, red, green, blue);
As Aaronaught points out, if your ARGB is in that order, there is an overload for FromARGB that accepts all components as a whole:
int argb = int.Parse(colorSpec.Substring(1), System.Globalization.NumberStyles.HexNumber);
Color fillColor = Color.FromArgb(argb);
source
share