Expand description
Configurable presentation rules for the TUI ([palette] in opys.toml).
Each named entry has a list of matchers ({status?, type?}) and a style.
A document matches an entry when any matcher matches (a matcher matches when
every field it constrains equals the document’s). For a document, the styles
of all matching entries are merged field-wise in ascending specificity
(number of constrained fields in the matched matcher; ties broken by entry
name), so more-specific rules override less-specific ones — a bug that is
blocked can take the bug icon and the blocked color.
This module is part of the core (always compiled): the engine parses and
validates the palette even without the tui feature. The TUI maps the
resolved Style onto ratatui colors/modifiers; see tui::theme.
Structs§
- Matcher
- A match condition. All fields optional; an empty matcher matches everything.
- Palette
Entry - One palette rule: when any matcher matches, its style contributes.
- Style
- The presentational attributes a rule can set. All optional so styles compose.
Enums§
- Color
Spec - A parsed color spec. The TUI maps this onto a concrete ratatui color.
- Named
Color - The ANSI-ish named colors a palette may reference (the ratatui base set).
Functions§
- parse_
color - Parse a color string: a name (case-insensitive),
#rgb/#rrggbbhex, or a0-255palette index. ReturnsNoneif it is not a valid color. - resolve
- Resolve the merged
Stylefor a document from the whole palette.has_taganswers tag matchers (exact tag or tag key).