else if("spectrum".equals(type)) return new SpectrumColormap();
else if("linear".equals(type)) {
boolean isEmpty1=StringUtil.isEmpty(lineColor1);
boolean isEmpty2=StringUtil.isEmpty(lineColor2);
if(isEmpty1 && isEmpty2) return new LinearColormap();
else if(!isEmpty1 && !isEmpty2) {
Color color1 = ColorCaster.toColor(lineColor1);
Color color2 = ColorCaster.toColor(lineColor2);
return new LinearColormap(color1.getRGB(),color2.getRGB());
}
else
throw new FunctionException(pc, "ImageFilterColorMap", 2, "lineColor1", "when you define linecolor1 you have to define linecolor2 as well");
}