Color (Element root, String name, Color defaultValue) { String colorValue = JDOMExternalizer.readString(root, name); if (colorValue != null) { try { return new Color(Integer.parseInt(colorValue, 16)); } catch (NumberFormatException e) { // Ignore } } return defaultValue; }