Expression fromColorExpr = sB.colorExpression(new java.awt.Color(fromColor.getRed(), fromColor.getGreen(),
fromColor.getBlue(), 255));
Expression toColorExpr = sB.colorExpression(new java.awt.Color(toColor.getRed(), toColor.getGreen(), toColor
.getBlue(), 255));
Expression fromExpr = sB.literalExpression(values[0]);
Expression toExpr = sB.literalExpression(values[1]);
Expression opacityExpr = sB.literalExpression(opacity);
ColorMapEntry entry = sf.createColorMapEntry();
entry.setQuantity(fromExpr);
entry.setColor(fromColorExpr);