Package org.geotools.mbstyle.expression
Class MBColor
-
- All Implemented Interfaces:
Expression
,Function
public class MBColor extends MBExpression
A class to transform mapbox color expressions into GeoTools expressions.
-
-
Field Summary
-
Fields inherited from class MBExpression
colors, decisions, featureData, ff, heatMap, json, lookUp, math, name, parse, ramps, string, transformer, types, variableBindings, zoom
-
Fields inherited from class FunctionImpl
functionName
-
Fields inherited from interface Expression
NIL
-
-
Constructor Summary
Constructors Constructor Description MBColor(JSONArray json)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Expression
colorRGB()
Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1.Expression
colorRGBA()
Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1.Expression
colorToRGBA()
Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.Expression
getExpression()
Determines which expression to use.-
Methods inherited from class MBExpression
canCreate, create, getName, throwInsufficientArgumentCount, throwUnexpectedArgumentCount, transformExpression, transformLiteral
-
Methods inherited from class FunctionImpl
accept, dispatchArguments, equals, evaluate, functionName, getFallbackValue, getFunctionName, getParameters, getParameterValue, getParameterValue, hashCode, setFallbackValue, setName, setParameters, toString
-
Methods inherited from class ExpressionAbstract
evaluate
-
Methods inherited from interface Expression
evaluate
-
-
-
-
Method Detail
-
colorRGB
public Expression colorRGB()
Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error. Example: ["rgb", number, number, number]: color- Returns:
- Color expression
-
colorRGBA
public Expression colorRGBA()
Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error. Example: ["rgba", number, number, number, number]: color- Returns:
- Color expression
-
colorToRGBA
public Expression colorToRGBA()
Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order. Example: ["to-rgba", color]: array<number, 4>- Returns:
- color expression
-
getExpression
public Expression getExpression() throws MBFormatException
Description copied from class:MBExpression
Determines which expression to use.- Specified by:
getExpression
in classMBExpression
- Throws:
MBFormatException
-
-