Skip to main content

Module contract

Module contract 

Source
Expand description

The contract: the system and component tokens every theme provides.

Structs§

Renamed
A token renamed in the contract: from is read as to in a file written for a contract older than contract.
Required
A token the contract requires.

Enums§

Tier
The tier of a token.

Constants§

CATEGORY
The categorical palette, in order: one colour per series of a chart, for what is told apart by identity (an entity, a sensor, a run), not by magnitude. A series keeps its slot whatever else is shown, so its colour follows it. Each slot reads at 3:1 on the canvas, the panel and the raised surface (crate::contrast::PAIRS), and slots are told apart as crate::contrast::check_category measures.
CONTRACT_VERSION
The version of the contract: which tokens exist, under which names.
LOG_LEVELS
The log levels’ colours, from the least to the most severe: trace, debug, info, warn, error, the levels of the log facade, and critical, past error (the level some loggers add: Python’s, Rerun’s text log). A log view colours a line’s level (or the line) with them; each reads as text on the canvas and the panel (crate::contrast::PAIRS).
RENAMED
The renames between contract versions, oldest first, applied when a file stamped with an older contract is loaded: each former name is read under its new one, with a warning saying to update the file. Each entry stays for RENAME_WINDOW minor releases after the one that added it. Empty while the contract is at its first version.
RENAME_WINDOW
How many minor releases after the one renaming a token its former name is still read: renamed in 0.N, read (with the “update your file” warning) in 0.N, 0.N+1 and 0.N+2, its entry dropped in 0.N+3. After that, the former name loads as a token the base theme does not have (a warning). A test fails when an entry of RENAMED outlives it.

Functions§

contract
Every token a theme must provide: the system tier, the component tier and the default kit’s components. A theme missing one, or giving one of another type, gets the built-in pop-dark value for it and a reported problem.
kit_contract
The default kit’s components’ part of the contract (tab.*, title-bar.*…): their first path segment names the components a kit can describe.
required
The contract entry for a path.