@Override
protected Color doParse(final Object context, final String text) {
try {
if (text.startsWith("0x")) {
return new Color(Integer.parseInt(text.substring(2), 16));
} else if (text.startsWith("#")) {
return new Color(Integer.parseInt(text.substring(1), 16));
} else {
return new Color(Integer.parseInt(text));
}
} catch (final NumberFormatException e) {
throw new TextEntryParseException("Not a number " + text, e);
}
}