pub struct Theme { /* private fields */ }Expand description
CLI theme with selectable color palettes and optional typewriter effects.
Precedence: --color flag > NO_COLOR env var > TTY auto-detection.
Draw (typewriter) is enabled by default on interactive TTY, disabled with --no-draw.
Implementations§
Source§impl Theme
impl Theme
pub fn detect() -> Self
pub fn from_flags(color_flag: &str, theme_flag: &str) -> Self
pub fn resolve(mode: ColorMode, variant: ThemeVariant) -> Self
pub fn plain() -> Self
pub fn with_draw(self, draw: bool) -> Self
pub fn with_nerdmode(self, nerd: bool) -> Self
pub fn colors_enabled(&self) -> bool
pub fn draw_enabled(&self) -> bool
pub fn variant(&self) -> ThemeVariant
pub fn nerdmode(&self) -> bool
pub fn icon_ok(&self) -> &'static str
pub fn icon_action(&self) -> &'static str
pub fn icon_warn(&self) -> &'static str
pub fn icon_detail(&self) -> &'static str
pub fn icon_error(&self) -> &'static str
Sourcepub fn accent(&self) -> &'static str
pub fn accent(&self) -> &'static str
Emphasis/highlight color. Bright green, bright orange, or bold depending on variant.
Sourcepub fn dim(&self) -> &'static str
pub fn dim(&self) -> &'static str
Body-text color. Matches the variant’s base tone; empty for Terminal.
Sourcepub fn mono(&self) -> &'static str
pub fn mono(&self) -> &'static str
Monospace-value color. Same as accent for CRT variants; bold for Terminal.
Sourcepub fn success(&self) -> &'static str
pub fn success(&self) -> &'static str
Bright green. Explicit “all passed” summaries, enabled/active states.
Sourcepub fn info(&self) -> &'static str
pub fn info(&self) -> &'static str
Bright cyan. Auto-fix actions, debug info, discovery output.
pub fn bold(&self) -> &'static str
Sourcepub fn reset(&self) -> &'static str
pub fn reset(&self) -> &'static str
Soft reset: clears styles and re-tints to the variant’s body color. For Terminal variant, this is a plain reset (no tint).
Sourcepub fn hard_reset(&self) -> &'static str
pub fn hard_reset(&self) -> &'static str
Hard reset: returns terminal to default colors. Use at program exit.
Sourcepub fn typewrite(&self, text: &str, delay_ms: u64)
pub fn typewrite(&self, text: &str, delay_ms: u64)
Typewrite to stderr, character-by-character. ANSI sequences emitted instantly. Skips delay when draw is disabled (instant print).
Sourcepub fn typewrite_line(&self, text: &str, delay_ms: u64)
pub fn typewrite_line(&self, text: &str, delay_ms: u64)
Typewrite to stderr + newline.
Sourcepub fn typewrite_stdout(&self, text: &str, delay_ms: u64)
pub fn typewrite_stdout(&self, text: &str, delay_ms: u64)
Typewrite to stdout, character-by-character.
Sourcepub fn typewrite_line_stdout(&self, text: &str, delay_ms: u64)
pub fn typewrite_line_stdout(&self, text: &str, delay_ms: u64)
Typewrite to stdout + newline.