if(value instanceof LightFilter.Material)
return (LightFilter.Material) value;
Struct sct = Caster.toStruct(value,null);
if(sct!=null){
Material material = new LightFilter.Material();
material.setDiffuseColor(toColorRGB(sct.get("color"), argName+".color"));
material.setOpacity(Caster.toFloatValue(sct.get("opacity")));
return material;
}
String str = Caster.toString(value,null);
if(str!=null){
String[] arr = ListUtil.listToStringArray(str, ',');
if(arr.length==2) {
Material material = new LightFilter.Material();
material.setDiffuseColor(toColorRGB(arr[0], argName+"[1]"));
material.setOpacity(Caster.toFloatValue(arr[1]));
return material;
}
throw new FunctionException(ThreadLocalPageContext.get(), "ImageFilter", 3, "parameters", "use the following format [color,opacity]");
}