(FunctionUtilities.resolveParameter(layoutProcess, element, values[1]));
final float lightValue = validateOtherParameter
(FunctionUtilities.resolveParameter(layoutProcess, element, values[2]));
final float[] rgb = ColorUtil.hslToRGB
(hueValue, saturationValue, lightValue);
return new CSSColorValue(rgb[0], rgb[1], rgb[2]);
}
else if (values.length == 4)
{
final int hueValue = validateHueParameter
(FunctionUtilities.resolveParameter(layoutProcess, element, values[0]));
final float saturationValue = validateOtherParameter
(FunctionUtilities.resolveParameter(layoutProcess, element, values[1]));
final float lightValue = validateOtherParameter
(FunctionUtilities.resolveParameter(layoutProcess, element, values[2]));
final float alphaValue = validateOtherParameter
(FunctionUtilities.resolveParameter(layoutProcess, element, values[3]));
final float[] rgb =
ColorUtil.hslToRGB(hueValue, saturationValue, lightValue);
return new CSSColorValue(rgb[0], rgb[1], rgb[2], alphaValue);
}
else
{
throw new FunctionEvaluationException("Expected either three or four parameters.");
}