Expand description
Semantic terminal color with standard opt-out.
A small, dependency-free color layer for CLI reporters: a ColorChoice
(auto/always/never) resolves — together with the NO_COLOR standard
and TTY detection — into an effective on/off Palette. The palette exposes
semantic styles (success/error/warn/info/dim/bold) that emit ANSI SGR escapes
when enabled and return the plain string when not, so the same rendering code
stays byte-clean on pipes and honors user preference.
Structs§
- Palette
- A resolved, semantic color palette.
Enums§
- Color
Choice - A user’s requested color policy, before environment/TTY resolution.
Constants§
- NO_
COLOR_ ENV - The environment variable that, when present (regardless of value), disables
color regardless of any explicit choice (the
NO_COLORstandard).
Functions§
- no_
color_ env_ set - Whether the
NO_COLORenvironment variable is present. - resolve_
color - Resolve a
ColorChoiceinto an effective on/off decision. - resolve_
color_ with - Pure resolver core: fold an explicit
NO_COLORpresence and TTY detection into an effective on/off decision (env-free, so it is unit-testable).