* Private constructor for typesafe enum.
* @param name the StyleColorName that this supports.
*/
public NamedColor(StyleColorName name) {
this.colorName = name.getName();
StyleColorRGB standardRGB = name.getRGB();
if (standardRGB == null) {
// There is no standard RGB value so it must be a system color.
SystemColor systemColor =
(SystemColor) NAME_2_SYSTEM_COLOR.get(name);
hex = awtColorToHex(systemColor);
} else {
hex = ColorConverter.convertColorRGBToText(
standardRGB.getRGB(), false).toUpperCase();
}
}