<sk-composite-color-map>

← prev index next →

Layers several color-maps into one — stacking them back-to-front, each blended onto the ones below with its own blend mode — the way to build a rich, multi-part color response that a single ramp or dither could not express alone.

Remarks

This is the layering member of the ColorMap family: like every color-map it turns a driver value into a color, but instead of computing that color directly it composites a list of child color-maps. The children are listed back-to-front (first is the bottom layer); each is blended onto the accumulated result of the layers beneath it, and the final stacked color is what this map emits. A field on a child restricts where that child contributes, so one layer can be masked to part of the surface while the layers below show through.

Key attributes. color-maps is the ordered, space-separated id-reference list of the child maps (back-to-front). blend-modes is the matching space-separated list of per-layer blend modes (normal, screen, multiply, …), one per child; the mode lives on the composite entry, not on the child, so the same color-map can appear in different composites with different modes. The composite emits only the raw stacked color — the consumer (sk-tonemap or sk-color-map-source) applies its field and the base-color compositing exactly once, so nothing is double-counted.

Related. Its children are any color-maps — sk-ramp-color-map, the dither maps (sk-ordered-dither-color-map, sk-blue-noise-dither-color-map, sk-halftone-dither-color-map), or even nested composites. It is driven from LIGHT by a sk-tonemap or from SPACE by a sk-color-map-source (a field's spatial weight becomes the driver t). To layer color-sources rather than color-maps, the analogue is sk-composite-color-source.

Serve these docs to run the live example. WebGPU needs a secure context — open this page via grunt serve rather than double-clicking the file. The Markup tab works from disk.

Attributes

AttributeTypeDefaultDescription
remap-curveanimatable <remap-curve> Optional tone-response remap curve, mirroring the field family's
remap-phaseanimatable <number> 0 Horizontal remap phase — an animatable scalar that translates the tone
id <id> The element's unique identifier — the standard HTML global id attribute.
fieldanimatable <id-ref> Gets the optional field that modulates this color-map's weight reference by id
color-maps <id-ref-list> (<id-ref>[,<id-ref>]*) "" The color-maps <id-ref-list> as a property. Reads / writes the
blend-modes <blend-mode-list> (<blend-mode>[,<blend-mode>]*) "" The companion blend-modes list as a property. Reads / writes the
color-interpolation <blend-color-interpolation> ("auto" | "srgb" | "srgb-linear") "auto" The color space this composite runs its per-layer BLEND + src-over math

Children

One or more color-map children layered front-to-back per CSS Compositing Level 1.