ToColor

class ToColor(val child: MvtExpression<*>, val parseColor: (String) -> Color?? = null) : MvtExpression<Color>

["to-color", value] — pass-through if child already evaluates to a Color; otherwise yields null. Mapbox also accepts a parseColor hex/css coercion of String inputs; pass parseColor to enable that path.

Constructors

Link copied to clipboard
constructor(child: MvtExpression<*>, parseColor: (String) -> Color?? = null)

Properties

Link copied to clipboard
Link copied to clipboard
val parseColor: (String) -> Color??

Functions

Link copied to clipboard
open override fun evaluate(ctx: MvtExpression.EvalContext): Color?
Link copied to clipboard

True when this expression (or any sub-expression) reads per-feature data — i.e. its result can differ between two features in the same tile at the same zoom. That means a reference to a feature property (Get / Has), the feature's dynamic state (FeatureState), its geometry type (GeometryType), or its line-progress parameter (LineProgress).