Documentation
¶
Overview ¶
Package style is the only place in the CLI that decides what color something is. Callers never construct ANSI codes or reference a hex color directly.
Index ¶
- func Accent(s string) string
- func Dim(s string) string
- func Disable()
- func Enable()
- func EnableForTests()
- func Error(s string) string
- func Header(s string) string
- func Logo(width int) string
- func StatusColor(value string) string
- func Success(s string) string
- func Warning(s string) string
- type Palette
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnableForTests ¶
func EnableForTests()
Forces a real color profile so tests can assert on colored output, since go test has no terminal attached. Not for production code.
func Logo ¶
Width 0 means the terminal size is unknown (piped output) and falls back to the compact form: a wrapped logo reads as corruption.
func StatusColor ¶
Types ¶
type Palette ¶
type Palette struct {
// contains filtered or unexported fields
}
Renders at a fixed setting, so callers on different streams gate on their own — piping stdout must not strip color from a live stderr message.
func Default ¶
func Default() Palette
Default reads the package gate at call time, not capture time, so Disable() still takes effect after flag parsing.
func NewPalette ¶
func (Palette) StatusColor ¶
Leaves an unrecognised status unstyled rather than guessing. Exact-word match, so "proactive" cannot trigger on "active".