Package org.geotools.mbstyle.expression
Class MBColor
- All Implemented Interfaces:
Expression
,Function
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 -
Method Summary
Modifier and TypeMethodDescriptioncolorRGB()
Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1.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.Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.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
-
Constructor Details
-
MBColor
public MBColor(JSONArray json)
-
-
Method Details
-
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
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
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
Description copied from class:MBExpression
Determines which expression to use.- Specified by:
getExpression
in classMBExpression
- Throws:
MBFormatException
-