Documentation
¶
Overview ¶
Package style is bumper's plain-output color palette — the terminal counterpart of the web app's <Terminal> components. It wraps lipgloss so that color is applied only when the destination is a real terminal: piping, redirecting, a non-TTY writer, or NO_COLOR all degrade to plain text automatically (lipgloss/ termenv detects this from the writer), and truecolor downsamples to 16-color on terminals that lack it. Severity is always conveyed by the word, never by color alone, so the output stays legible with color off.
Only semantic tokens are colored (severity, the ●/○ section glyphs, the accent prompt, sources, success/fix) — never body text — so it reads correctly on both light and dark terminal backgrounds. The deterministic engine never imports this.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Glyphs ¶
type Glyphs struct {
Dot, Ring, Check, Warn, Cross, Pause, Bullet, Mid string
}
Glyphs is a small terminal glyph set with a plain-ASCII fallback.
type Palette ¶
type Palette struct {
// Glyphs is the Unicode/ASCII glyph set chosen for the current locale.
Glyphs Glyphs
// contains filtered or unexported fields
}
Palette holds the styles for one writer. Build it per destination with New.
func New ¶
New builds a palette bound to w. If w is a terminal it colors; otherwise (pipe, file, bytes.Buffer in tests) lipgloss yields plain text. Colors match the web app's --term-* tokens.