interpolate

Produces continuous, smooth results by interpolating between pairs of input and output values (stops), given the input value.

Requires the type of interpolation to use. Use linear, exponential, or cubicBezier.

Example:

interpolate(
exponential(2), zoom(),
16 to const(1),
24 to const(256),
)

interpolates exponentially from 1 to 256 in zoom levels 16 to 24. Below zoom 16, it is 1, above zoom 24, it is 256. Applied to for example line width, this has the visual effect that the line stays the same width in meters on the map (rather than on the viewport).