Color.FromArgb(0xB5C7DE);
or if you want to parse a string
private Color ParseColor(string s, Color defaultColor) { try { ColorConverter cc = new ColorConverter(); Color c = (Color)(cc.ConvertFromString(s)); if (c != null) { return c; } } catch (Exception) { } return defaultColor; }
This function simply returns the default value if it cannot parse s. You can simply throw an exception if you prefer to handle the exceptions yourself.
Lou franco
source share