Skip to main content

Module theme

Module theme 

Source

Structs§

TextStyle
a text style of a theme: size in DIP (24.8), line height in DIP, weight 100..900; None = the style’s (a size alone scales the style’s line height with it)
Theme
an app theme (see the module header); Default = nothing overridden
ThemeError
why a theme could not be read or applied: the line of the file (0: not a line) and the message in the UI language (“Zeile 4: …”)

Enums§

Radius
rounded corners of a theme: every corner radius that is not a pill becomes this many DIP, or the style’s radius scaled by this percentage

Constants§

THEME_CONTRAST
… high contrast
THEME_DARK
… the dark theme
THEME_LIGHT
Theme::colors / accent index: the light theme
TOKEN_NAMES
the T_* tokens by name, in token order (index = token / 4); theme files write them in lower case
TS_NAMES
the TS_* text styles by name (theme files: body.size, title.weight)

Functions§

color_mix
color_mix(a, b, t): per-channel a + (b - a) * t / 256 (t 0..256), every channel including alpha
contrast_ratio
the WCAG 2 contrast ratio of two colours (alpha ignored): 1 (equal) .. 21 (black on white); text needs 4.5 (large text 3), graphical objects and controls 3
contrast_tokens
the tokens of a high-contrast scheme: opaque fills from its colours, borders and strokes in the text colour, accents in the highlight colour, links in the link colour
luminance
the WCAG 2 relative luminance of 0xRRGGBB (alpha ignored): 0 black .. 1 white
token_index
the T_* index of a token name (any case, “T_” in front allowed)