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.
ConfiguredComforts
The comforts a settings document names (Theme::configured_comforts): None where it names none, which leaves the host’s own value.
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.
FinishLayer
The person’s own finish over whichever theme is shown: the interface face they read best, their accent, and how much of the theme’s translucency they keep. All are roles the theme already has (PIN_TYPE, PIN_EMPHASIS, PIN_MATERIAL); this layer only says the person would rather have them their way than the theme’s, so no custom theme has to be written for a face, a colour or a blur.
SurfaceShape
The surface a window’s content is drawn on, as the scene being drawn sees it: its bounds and the radius of each of its corners, 0 where a corner is square. A host that knows the shape it shows a window in puts it on the window’s theme (Theme::surface); what runs along the window’s edges (a scroll bar) keeps its ends out of a rounded corner.
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
What every surface role is made of (Finish per crate::tokens::SurfaceRole), and the finish of selectors. A role a document leaves out keeps its stock finish.
ThemeMotion
The motion of the shared UI: its curve, the character of its springs (0 calm, 1 the stock snappy motion, 2 lively) and how long timed transitions take. Reduced motion still replaces movement with a fade.
ThemeShape
The window tile’s radius, from which every other radius derives concentrically (crate::tokens::Radii::from_window_radius; 0 makes every corner square), and how surfaces are outlined.
ThemeType
The UI face, the reading face and the body size every text role derives from.
ThemeWeights
The weights of the three tiers the type roles are set in: body text (body, caption, reading, code), labels (control labels and row titles) and headings (display down to subheading).
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.
MotionCurve
How the shared UI moves.
Preset
The themes Tilo ships.
ThemeWeight
A weight a theme may give a tier of text.

Constants§

APPEARANCE_SECTION
The settings section the person’s appearance lives in.
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 the device’s appearance section ([settings_store::appearance::DEVICE_SECTION]).
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.
DOCUMENT_ROOM
How many pages wide a pane is before a document’s text grows (Theme::document_zoom): a page then fills about two fifths of it.
LIGHT_THEME_KEY
appearance key: the theme light mode shows, a preset id or custom:<id>.
MAX_DOCUMENT_ZOOM
The most a document’s text grows in a wide pane: body text from 14 px to 21 px, about what the same page reads at on a laptop held at arm’s length against a desktop display across the desk.
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 schema this build writes.
TRANSLUCENCY_KEY
appearance key: how much of the theme’s translucency the person keeps, 1 as the theme sets it and 0 opaque (settings_store::appearance::TRANSLUCENCY).
UI_FACE_KEY
appearance key: the interface face the person chose, by name, over the theme’s own (settings_store::appearance::UI_FACE).
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).