Skip to main content

Module theme

Module theme 

Source
Expand description

The tray UI’s look: two palettes (dark, light) held to WCAG 2.2 AA contrast by tests, the egui visuals and style built from them, and the soft “breathing” glow of running work.

Structs§

Palette
Every colour the UI paints with.

Enums§

ThemeChoice
The operator’s theme choice (Config → This window).
Tone
What a colour means.

Constants§

BREATH_PERIOD_SECS
One breath of the running glow, in seconds: slow enough to read as calm.
CARD_RADIUS
Corner radius of cards and panels, in points.
CONTROL_RADIUS
Corner radius of buttons, inputs and pills, in points.
NON_TEXT_CONTRAST_MIN
WCAG 2.2 AA minimum contrast for indicators and focus rings (1.4.11).
TEXT_CONTRAST_MIN
WCAG 2.2 AA minimum contrast for text (1.4.3).

Functions§

apply
Apply both palettes and the operator’s theme choice to ctx.
breath
How strongly running work glows at time t (seconds), 0.35 to 1.0: one slow breath per BREATH_PERIOD_SECS. Reduce motion holds it steady at full strength.
contrast_ratio
WCAG contrast ratio between two opaque colours, 1.0 to 21.0.
luminance
WCAG relative luminance of an opaque colour.
stroke
A stroke of width points (typed, so float literals never fall back).
style_tweaks
Type scale and spacing, the same in both themes.
visuals
The egui visuals of palette.
with_alpha
colour at alpha (0..=1), for glows over any background.