public function validate($value, ValidationResult $result = null)
{
if ($result === null) {
$result = new ValidationResult($value);
}
// the $value must be one that we support
$value = strtolower($value);
if (!isset($this->supportedValues[$value])) {
$result->addError(static::MSG_UNKNOWNCOLORLEVEL);
return $result;
}
return $result;
}