{ "version": 8, "metadata": { "test": { "width": 100, "height": 100, "allowed": 0.00075 } }, "zoom": 2, "sources": { "gradient": { "type": "geojson", "data": { "type": "Feature", "properties": {}, "geometry": { "type": "LineString", "coordinates": [ [ -1, 8 ], [ 8, 1 ], [ 1, -8 ], [ -8, -1 ], [ 1, 4 ], [ 4, -1 ], [ -1, -4 ], [ -2, 0 ] ] } }, "lineMetrics": true } }, "layers": [ { "id": "line", "type": "line", "source": "gradient", "layout": { "line-cap": "round", "line-join": "round" }, "paint": { "line-width": 10, "line-gradient": [ "interpolate", ["linear"], ["line-progress"], 0, "rgba(255, 0, 0, 1)", 0.35, "rgba(255, 0, 0, 0)", 0.351, "rgba(255, 0, 0, 1)", 0.5, "rgba(255, 0, 0, 0.5)", 0.75, "rgba(255, 0, 0, 0)", 1, "rgba(255, 0, 0, 1)" ] } } ] }