Skip to main content

Module theme

Module theme 

Source
Expand description

The interface’s look, declared once (ADR-0252): colour roles, a type scale, spacing, a corner radius, and motion timings with one easing curve.

Every engine-drawn surface — the standalone’s overlays, the core’s now-playing banner and diagnostics panel, and so the foobar component’s panel too — reads its values from THEME. The studio’s tokens.css is generated from the same table by css, and core/tests/suite/ui_tokens.rs fails when the committed file differs from what this module renders.

The table names roles, never uses: accent, not browser_row_selected. A surface restyle is a change of which role a surface reads.

§Colour encoding

A Color holds sRGB-encoded components in 0.0..=1.0, the numbers a hex literal spells. That is what the text layer takes (glyphon treats its colours as sRGB and linearises them for an sRGB target) and what CSS takes. A pass that writes a colour straight out of a shader onto the *Srgb surface — the diagnostics panel’s quads — must hand the shader Color::linear instead, or every value lands lighter than declared.

Pure data, no platform or windowing type: this module is part of the source-agnostic core and compiles in every build, with or without text.

Structs§

Color
One colour role: sRGB-encoded RGBA, each component in 0.0..=1.0.
Ease
The one easing curve every surface moves on, as CSS’s cubic-bezier(x1, y1, x2, y2) with the endpoints pinned at (0, 0) and (1, 1).
Theme
The whole look. One instance, THEME; a field is a role, a step, or a timing, and never names the surface that reads it.

Constants§

REFERENCE_HEIGHT
The reference target height Theme::type_scale and Theme::space are declared at.
THEME
The look: direction A, “Amber phosphor” (Plan 0231 Phase 3) — a warm amber accent over cool dark neutrals, panels with a lit edge and a faint scanline, and one ease-out curve with a long settle.

Functions§

css
The studio’s tokens.css, rendered from THEME.