Expand description
§Display theme
The one source of every color and text style that scope shows in a
terminal: CLI output, the TUI and the monitor. Callers name a semantic
Role; tone is the single mapping from a role to its look.
This module is presentation policy. It holds no framework type: the
adapters translate a Tone to their medium (the text painter in
text for CLI output; ratatui styles in the CLI crate).
Only the 16 named ANSI colors are used, so the terminal’s own palette decides the exact shade on dark and light themes.
Re-exports§
pub use crate::config::ColorScheme as Scheme;
Structs§
- Painter
- Paints text for one output stream: with escape codes when color is on for it, as the text unchanged when color is off.
- Tone
- How a role looks: a foreground color (
Nonekeeps the terminal’s default) and text effects.
Enums§
- Ansi
Color - The 16 named ANSI foreground colors.
- Direction
- Which way a monitored value moved.
- Role
- What a piece of text means. Callers pick a role; never a color.
Constants§
- SERIES_
TONES - The tones of the series of one chart, one per venue, in venue order (design 2026-11-04, section 2.9). None is a health color (green, yellow, red), and none is a bright variant, which is weak on a light background. From the fifth series the tones repeat; the chart tells those apart by their marker.
Functions§
- color_
enabled - Returns
truewhen output to stdout may use color. - color_
enabled_ stderr - Returns
truewhen output to stderr may use color. - color_
enabled_ with - Decides whether to emit color for one stream. Pure: the caller passes the environment and whether the stream is a terminal.
- paint
textin the tone ofrole, for stdout.- scheme_
role_ tone - The tone of
rolein a monitor underscheme. The monochrome scheme shows no color, so it keeps only the role’s effects (bold, dim, …). - scheme_
tone - The tone of a value that moved in
directionunder a monitor scheme. A flat value is always plain; the monochrome scheme is always plain. - set_
color_ override - Forces color off (
Some(false)) or on (Some(true)) for the whole process, or removes the override (None).--no-coloruses it. - tone
- The single mapping from a role to its tone. The role table in
docs/design/2026-10-13-tui-color-theme.mdis its specification.