Documentation
¶
Overview ¶
Package theme is the single home for the Volcano CLI color identity: the palette, the color-enable gate (NO_COLOR + real TTY), and the small string helpers commands use to style output. The interactive setup path and every resource command share it so the whole CLI reads as one product.
Every helper takes an explicit on bool and is a plain pass-through when off, so callers decide once (via On) whether the destination should get ANSI. Machine-read output (pipes, files, --json, CI, test buffers) stays plain.
Index ¶
- Constants
- func Command(s string, on bool) string
- func Dim(s string, on bool) string
- func Error(s string, on bool) string
- func Fail(s string, on bool) string
- func On(w io.Writer) bool
- func Status(s string, on bool) string
- func Success(s string, on bool) string
- func Title(s string, on bool) string
- func Warn(s string, on bool) string
- func Width(w io.Writer) int
Constants ¶
const ( FlameHex = "#f54019" // lava flame: key hints, suggested commands LavaHex = "#f37a58" // lava-500 brand primary: titles, table headers, CTA VolcanoHex = "#f97316" // volcano-500: success, active, installed OutdatedHex = "#eab308" // amber: warnings, pending/in-progress states GrayHex = "#6b7280" // neutral gray: summaries, separators, dim detail FailedHex = "#dc2626" // lava red: errors, failed states )
The Volcano palette, taken from volcano-web. Kept as exported consts so the setup report (lipgloss styles) and any other caller reference one source.
Variables ¶
This section is empty.
Functions ¶
func Fail ¶
Fail styles failure value text (red, not bold) — the counterpart to Error's prefix for message bodies and failed inline values.
func On ¶
On reports whether ANSI styling should be written to w: only when w is a real interactive terminal and NO_COLOR is unset. Piped output, files, other character devices (e.g. /dev/null), and test buffers stay plain so machine-read output is never polluted with escape codes.
func Status ¶
Status colors a status/state word by meaning. The caller pads s to its column width FIRST so the ANSI codes never count toward the width and break table alignment; Status classifies on the trimmed word but renders the padded s.
Types ¶
This section is empty.