Skip to main content

Module palette

Module palette 

Expand description

What a theme document says about colour (docs/design-language.md, “Colour” and “Theming”).

A Palette is a temperature (one OKLCH hue and a chroma at or below NEUTRAL_MAX_CHROMA), a lightness ladder for the six surfaces, three ink tiers and four muted status tones. Emphasis decides which hue the accent takes. Tone sets the lightness and chroma of the presence palette, whose twelve hues never move. Everything else (crate::tokens::Colors) is derived from these numbers in one place, so a palette can only say what the design language lets it say.

Structs§

InkLadder
OKLCH lightness of the three ink tiers, defined on the content surface.
Palette
The neutral material and its inks.
StatusTones
The four status tones. Their hues are STATUS_HUES.
SurfaceLadder
OKLCH lightness of every surface, 0 black to 1 white.
Tone
An OKLCH lightness and chroma at a hue the role fixes.

Enums§

Emphasis
Which hue the accent takes: primary actions, the selected row’s lift tint, links, the focus ring, the caret and the text selection (docs/design-language.md, “Colour roles”). An “on” state is never the accent; it is the on-state green (crate::tokens::Intents::on_state).

Constants§

NEUTRAL_MAX_CHROMA
Ceiling on the neutral material’s chroma. The neutrals carry a temperature, never a colour.
PRESENCE_CHROMA
See PRESENCE_LIGHTNESS.
PRESENCE_LIGHTNESS
The presence palette’s usable band: bright enough to read as colour, never so loud that one participant shouts.
STATUS_HUES
Status hues, in OKLCH degrees: danger, warning, success, info. A theme moves their lightness and chroma, never their meaning.
STATUS_MAX_CHROMA
Ceiling on status chroma: danger, warning and success are muted.
STOCK_CHROMA
See STOCK_HUE.
STOCK_HUE
The stock neutral temperature: a cool hue at a whisper of chroma, so the material reads as considered rather than as sterile grey, never as grey-blue.
SURFACE_LIGHT
The light a surface catches: the specular sheen across a glass body and the rim lit along its edge (crate::tokens::Colors::light, read by the Glass painter set).
TINTED_LIFT_CHROMA
Chroma of the selection lift under an accent (Emphasis::You and Emphasis::Tinted).