Skip to main content

Module color

Module color 

Source
Expand description

ANSI color/style helpers.

Every helper takes an explicit enabled flag rather than sampling the environment itself — callers decide whether to colorize using crate::terminal and pass the result in. This keeps styling decisions testable and keeps a single source of truth for “should this stream be colored” per invocation.

Modules§

aurora
The Aurora CLI token palette, kept as reusable shared defaults per repo convention (aurora-design-system/themes/editors/claude-code/TOKENS.md).

Functions§

ansi256_fg
Wrap text in an ANSI-256 foreground escape for token when enabled, otherwise return text unchanged. Use as a fallback on terminals that do not support 24-bit truecolor.
bold
Bold (SGR 1).
dim
Dim (SGR 2) — conventionally section rules and secondary text.
green
Standard ANSI green (SGR 32) — conventionally “success” / “ok”.
red
Standard ANSI red (SGR 31) — conventionally “error” / “failed”.
style
Wrap text in the given ANSI SGR code when enabled, otherwise return text unchanged.
truecolor_fg
Wrap text in a 24-bit truecolor foreground escape for token when enabled, otherwise return text unchanged.
yellow
Standard ANSI yellow (SGR 33) — conventionally “warning” / “hint”.