<sk-color-stop>

← prev index next →

One color at one position along a color ramp — the building block you place, offset, and animate to shape a sk-ramp-color-map's gradient.

Remarks

This is the stop element of the ColorMap family, the typed child of sk-ramp-color-map: a ramp is built from a sequence of these stops, each pinning a color to a position on the ramp. It is modeled on SVG's <stop> (hence the stop-offset / stop-color names). Unlike an inert keyframe, a color stop is itself a SkenraAnimatable, so its own values can change at runtime; each change notifies the owning ramp, which re-sorts its stops and rewrites GPU uniforms without recompiling (stops are shader data).

Key attributes. stop-offset is the position on the ramp in [0, 1] — driven through a sk-tonemap, 0 is full shadow and 1 is full light. stop-color is the color at that position. interpolation is the blend mode for the ramp segment that starts at this stop (linear | step | smooth), so a step stop produces a hard color band rather than a gradient.

Related. Its parent is always a sk-ramp-color-map; that ramp is typically driven by a sk-tonemap. Animating a stop uses the same <sk-animation> / <sk-keyframe> mechanism as any other animatable.

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
id <id> The element's unique identifier — the standard HTML global id attribute.
stop-offsetrequiredanimatable <number> 0 Gets the stop position on the ramp, returning the animated value
stop-colorrequiredanimatable <color> Gets the stop color, returning the animated value when animating.
interpolationanimatable <stop-interpolation> ("step" | "linear" | "smooth") "linear" Gets the interpolation mode for the segment starting at this stop,