final String type)
throws FunctionEvaluationException
{
if (value instanceof CSSValue)
{
throw new FunctionEvaluationException();
}
if (value instanceof String)
{
final String strVal = (String) value;
if ("length".equals(type))
{
return FunctionUtilities.parseNumberValue(strVal);
}
else if ("url".equals(type))
{
return FunctionUtilities.loadResource(layoutProcess, strVal);
}
else if ("color".equals(type))
{
final CSSValue colorValue = ColorUtil.parseColor(strVal);
if (colorValue == null)
{
throw new FunctionEvaluationException();
}
return colorValue;
}
else
{