Skip to main content

Module theme

Module theme 

Structs§

AccessibilityLayer
Accessibility layer. Nothing below it can lower contrast, shrink text, or turn motion back on.
AppearanceIntent
Polled by crate::app::App once per frame and reconciled against the live theme. Level-triggered like fullscreen_intent: a steady value is correct, since the App only re-themes when a field differs from what’s applied, so a settings pane can return the same intent every open frame.
ContentSurface
Tokens a content surface paints with when ContentSurface::forced is set. When it is clear, a document keeps its own page palette.
ContrastFinding
A floor a palette misses, and by how much.
ContrastFloor
One promise: foreground clears min_ratio against ground.
DistributionDefaults
Defaults a distribution ships with the OS image: a theme (a preset id or a whole document) and the pins in Self::policy.
DistributionPolicy
Policy pins on a distribution-defaults document.
Theme
ThemeDensity
The spacing scale, as a multiple of the stock 4 px scale. Pointer targets and control heights stay put.
ThemeDocument
A theme, as data. See the module documentation.
ThemeLayerStack
Inputs to resolve_theme_layers. Absent layers contribute nothing.
ThemeMaterial
The floating material: how strongly the backdrop behind floating chrome is blurred, and how opaque the overlay tint over it is.
ThemeMotion
The character of the shared UI springs: 0 calm, 1 the stock snappy motion, 2 lively. Reduced motion still replaces movement with a fade.
ThemeShape
The window tile’s radius. Every other radius derives from it concentrically (crate::tokens::Radii::from_window_radius).
ThemeType
The UI face, the reading face and the body size every text role derives from.
WindowAppearance
What the host showing a window knows about where, and for whom, it is shown: the temperature of the workspace the window is in and the colour of the person sitting at it. The shell resolves both and hands them to its own chrome and, over the shell-ui channel, to every app window (crate::floating_surface::FloatingSurfaceHostMessage::Appearance). A window nobody told stays neutral and wears the default colour.

Enums§

ContrastRole
A colour role a contrast floor is stated in. Grounds are surfaces and the selection lift; everything else is a foreground drawn on them.
Preset
The themes Tilo ships.

Constants§

AUTOMATIC_MODE
The mode meaning “light by day, dark by night”.
CUSTOM_THEMES_KEY
appearance key: the custom theme documents a custom:<id> names.
DARK_THEME_KEY
appearance key: the theme dark mode shows, a preset id or custom:<id>.
DENSITY_KEY
appearance key: the person’s density, over whichever theme is shown.
DISTRIBUTION_DEFAULTS_KEY
JSON key of the distribution-defaults object inside appearance.
DISTRIBUTION_DEFAULTS_SCHEMA_VERSION
The one distribution-defaults schema this build reads and writes.
DISTRIBUTION_LAYER_ID
JSON id of the distribution-defaults layer. The same layer is also read from DISTRIBUTION_DEFAULTS_KEY.
LIGHT_THEME_KEY
appearance key: the theme light mode shows, a preset id or custom:<id>.
MODE_KEY
appearance key: "dark", "light" or "automatic".
PINNABLE
Every role a distribution may pin.
PIN_DENSITY
Pin id for the spacing scale.
PIN_EMPHASIS
Pin id for the emphasis (inverted or tinted).
PIN_MATERIAL
Pin id for the floating material.
PIN_MOTION
Pin id for the motion character.
PIN_PALETTE
Pin id for the palette (hue, chroma, ladder, ink, status).
PIN_PRESENCE
Pin id for the presence tone.
PIN_SHAPE
Pin id for the window radius.
PIN_TYPE
Pin id for the UI face and base size.
THEME_SCHEMA_VERSION
The one schema this build reads and writes.
WORKSPACE_TEMPERATURES_KEY
appearance key: per-workspace temperature overrides, OKLCH degrees by workspace id.

Functions§

is_automatic_mode
Whether mode (the appearance.mode value) asks for light by day and dark by night.
local_moment
The local wall-clock moment the day/night schedule is evaluated at, read through the toolkit clock.
resolve_theme_layers
Resolve the stack. Order, lowest first:
user_document
Which theme the mode and schedule in settings show, and with the person’s density over it. None when the appearance section names no theme, or names one this build does not admit (an unknown preset, a missing custom document, another schema).
workspace_hue
The neutral temperature a workspace takes from its wallpaper (RGBA8 pixels): the image’s dominant hue, or None for a wallpaper with none (a grey photograph, a missing file), which leaves the material neutral. Only the hue is taken — the material never gains chroma from a wallpaper.
workspace_temperature_override
The person’s temperature for workspace id, in OKLCH degrees, when they set one over its wallpaper’s (appearance.workspace_temperatures).