41 lines
879 B
JSON
41 lines
879 B
JSON
{
|
|
"expression": [
|
|
"interpolate-lab",
|
|
["linear"],
|
|
["get", "x"],
|
|
1,
|
|
"red",
|
|
11,
|
|
["get", "color"]
|
|
],
|
|
"inputs": [
|
|
[{}, {"properties": {"x": 0, "color": "blue"}}],
|
|
[{}, {"properties": {"x": 5, "color": "blue"}}],
|
|
[{}, {"properties": {"x": 11, "color": "blue"}}],
|
|
[{}, {"properties": {"x": 11, "color": "oops blue"}}]
|
|
],
|
|
"expected": {
|
|
"compiled": {
|
|
"result": "success",
|
|
"isFeatureConstant": false,
|
|
"isZoomConstant": true,
|
|
"type": "color"
|
|
},
|
|
"outputs": [
|
|
[1, 0, 0, 1],
|
|
[0.599999, 7.22057e-8, 0.4, 1],
|
|
[0, 0, 1, 1],
|
|
{"error": "Could not parse color from value 'oops blue'"}
|
|
],
|
|
"serialized": [
|
|
"interpolate-lab",
|
|
["linear"],
|
|
["number", ["get", "x"]],
|
|
1,
|
|
["rgba", 255, 0, 0, 1],
|
|
11,
|
|
["to-color", ["get", "color"]]
|
|
]
|
|
}
|
|
}
|