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
textin an ANSI-256 foreground escape fortokenwhenenabled, otherwise returntextunchanged. 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
textin the given ANSI SGRcodewhenenabled, otherwise returntextunchanged. - truecolor_
fg - Wrap
textin a 24-bit truecolor foreground escape fortokenwhenenabled, otherwise returntextunchanged. - yellow
- Standard ANSI yellow (SGR 33) — conventionally “warning” / “hint”.