CompositeColorMap

← 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.

Constructor

constructor(config?: { children?: ColorMap[] })

Properties

Config Properties

PropertyTypeDefaultDescriptionDeclared by
childrenconfig-only ColorMap[] Initial child color-maps (back-to-front), each with the default blend mode. CompositeColorMapConfig

Other Properties

PropertyTypeDefaultDescriptionDeclared by
layersread-only readonly ColorMap[] Ordered list of child color-maps (back-to-front). CompositeColorMap
layerEntriesread-only readonly CompositeColorMapLayer[] Ordered list of layer entries (back-to-front), each with its blend mode. CompositeColorMap
colorMaps string "" The color-maps <id-ref-list> as a property. Reads / writes the CompositeColorMap
blendModes string "" The companion blend-modes list as a property. Reads / writes the CompositeColorMap
fieldanimatable Field | null Gets the optional field that modulates this color-map's weight ColorMap
remapCurveanimatable SampledCurve | null Optional tone-response remap curve, mirroring the field family's ColorMap
remapCurveSourceread-only string | null The descriptor the curve was authored from, or null (imperative/none). ColorMap
remapPhaseanimatable number 0 Horizontal remap phase — an animatable scalar that translates the tone ColorMap
sceneread-only any Gets the Scene this animatable belongs to, if any. SkenraAnimatable
animationsread-only SkenraAnimation[] Public getter for the animations affecting this target. SkenraAnimatable

Methods

MethodDescriptionDeclared by
addLayer(colorMap: ColorMap): void Convenience: appends a child color-map (rendered on top) with the CompositeColorMap
removeLayer(colorMap: ColorMap): void Convenience: removes a child color-map via the color-maps attribute. CompositeColorMap
animate(firstArg: TypedKeyframe<this>[] | TypedPropertyIndexedKeyframes<this> | Record<string, any> | globalThis.Keyframe[] | globalThis.PropertyIndexedKeyframes | null, secondArg?: number | KeyframeAnimationOptions | globalThis.KeyframeAnimationOptions): SkenraAnimation & Animation Creates a new SkenraAnimation for this target per Web Animations API. SkenraAnimatable
removeAnimation(animation: SkenraAnimation): boolean Removes a specific animation from this object. SkenraAnimatable
constrain(type: K, config: ConstraintConfigMap[K]): ConstraintReturnMap[K] Creates a constraint on this Animatable using a fluent API. SkenraAnimatable