override

fun UiThemeTokens.override(colors: UiColors? = null, stateColors: UiStateColors? = null, typography: UiTypography? = null, shapes: UiShapes? = null, controls: UiControlSizing? = null, interactions: UiInteractionTokens? = null, overlays: UiOverlays? = null): UiThemeTokens(source)

Creates an immutable partial override of this theme snapshot.

When colors is replaced without stateColors, state colors are re-derived from the replacement scheme. Otherwise unspecified families preserve their current values. The result always reports UiThemeOrigin.Override while retaining the current darkness and revision metadata.

Receiver

immutable theme snapshot used as the fallback for omitted families

Return

a new theme snapshot; this instance is never mutated

Parameters

colors

optional complete semantic color replacement

stateColors

optional state-aware color replacement; omitted values re-derive from colors when that family changes

typography

optional typography replacement

shapes

optional component shape replacement

controls

optional component sizing replacement

interactions

optional transient interaction-opacity replacement

overlays

optional modal overlay replacement