class Gradient extends Composite
The Gradient Composite Symbolizer creates gradients between a series of values and symbolizers or from values from Layer.
You can create a Gradient between a List of values and Styles:
 Gradient gradient = new Gradient(
    new Expression("PERSONS / LAND_KM"),
    [0,200],
    [new Fill("#000066") + new Stroke("black",0.1), new Fill("red") + new Stroke("black",0.1)],
    10,
    "exponential"
 )
 
 Or you can create a Gradient based on a classification method and a list of colors or a color brewer palette:
Gradient gradient = new Gradient(shapefile, "WORKERS", "Quantile", 5, "Greens")
| Fields inherited from class | Fields | 
|---|---|
class Symbolizer | 
                            filterFactory, styleBuilder, styleFactory, styleOptions, title | 
                        
| Constructor and description | 
|---|
                                Gradient(java.lang.Object expression, java.util.List values, java.util.List styles, int classes, java.lang.String method, boolean inclusive)Create a new Gradient by interpolating between a List of values and styles.  | 
                        
                                Gradient(Layer layer, java.lang.Object field, java.lang.String method, int number, java.lang.Object colors, java.lang.String elseMode)Create a new Gradient where the interpolation is based on a classification method based on values from the Layer's Field.  | 
                        
| Type Params | Return Type | Name and description | 
|---|---|---|
 | 
                            static java.util.List | 
                            createGraduatedSymbolizer(Layer layer, java.lang.String field, java.lang.String method, int number, java.lang.Object colors, java.lang.String elseMode)Create a graduated Symbolizer  | 
                        
| Methods inherited from class | Name | 
|---|---|
class Composite | 
                            getTitle, range, title, toString, where, zindex | 
                        
class Symbolizer | 
                            and, apply, asSLD, asSLD, buildString, composite, createGeoToolsSymbolizer, getDefault, getDefault, getGeoToolsSymbolizers, getGtStyle, getSld, getTitle, plus, prepare, prepare, range, range, sortBy, sortBy, title, where, zindex | 
                        
Create a new Gradient by interpolating between a List of values and styles.
expression -  An Expression or a String expression.values -  A List of valuesstyles -  A List of Stylesclasses -  The number of classesmethod -  The interpolation method (linear, exponential, logarithmic)inclusive -  Whether to include the last value of notCreate a new Gradient where the interpolation is based on a classification method based on values from the Layer's Field.
layer -  The Layerfield -  The Field or Field's namemethod -  The classification method (Quantile or EqualInterval)number -  The number of categoriescolors -  A Color Brewer palette name, or a List of ColorselseMode -  The else mode (ignore, min, max)Create a graduated Symbolizer
layer -  The Layerfield -  The Field namemethod -  The classification method (Quantile or EqualInterval)number -  The number of categoriescolors -  A Palette name, or a List of ColorselseMode -  The else mode (ignore, min, max)