if ((htmlColor == null) || (htmlColor.Length == 0))
return Color.Empty;
- switch (htmlColor.ToLower ()) {
+ switch (htmlColor.ToLowerInvariant ()) {
case "buttonface":
+ case "threedface":
return SystemColors.Control;
+ case "buttonhighlight":
+ case "threedlightshadow":
+ return SystemColors.ControlLightLight;
+ case "buttonshadow":
+ return SystemColors.ControlDark;
case "captiontext":
return SystemColors.ActiveCaptionText;
case "threeddarkshadow":
return SystemColors.ControlDarkDark;
+ case "threedhighlight":
+ return SystemColors.ControlLight;
case "background":
return SystemColors.Desktop;
case "buttontext":
return SystemColors.ControlText;
case "infobackground":
return SystemColors.Info;
+ // special case for Color.LightGray versus html's LightGrey (#340917)
+ case "lightgrey":
+ return Color.LightGray;
}
+
TypeConverter converter = TypeDescriptor.GetConverter (typeof (Color));
return (Color) converter.ConvertFromString (htmlColor);
}