RasterSymbolizer rasterSym = sf.createRasterSymbolizer();
ColorMap colorMap = sf.createColorMap();
ArrayList<CoverageRule> rulesList = colorRulesEditor.getRulesList();
for( int i = 0; i < rulesList.size(); i++ ) {
CoverageRule coverageRule = rulesList.get(i);
if (!coverageRule.isActive()) {
continue;
}
Color fromColor = coverageRule.getFromColor();
Color toColor = coverageRule.getToColor();
double[] values = coverageRule.getFromToValues();
double opacity = coverageRule.getOpacity();
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));