Color (@Nullable String value) { if (value == null) { return null; } Color color; try { int rgb = Integer.parseInt(value, 16); color = new Color(rgb); } catch (NumberFormatException e) { LOG.debug("Wrong color value: " + value, e); throw new InvalidDataException("Wrong color value: " + value, e); } return color; }