Documentation
¶
Overview ¶
Package palette is the single source of truth for NextDeploy's terminal colours. The values mirror the website palette in frontend/app/brand.css: warm graphite with an amber "phosphor terminal" accent and sage for success. Keep the two in sync when either changes.
Codes are computed at call time from the environment:
- NO_COLOR (any non-empty value) disables every code, Bold and Reset included.
- FORCE_COLOR (non-empty, not "0") enables codes even when stderr isn't a terminal.
- Otherwise codes are only emitted when stderr is a terminal, so logs piped to a file, CI, or an AI agent stay plain text.
- COLORTERM=truecolor|24bit selects 24-bit escapes (\033[38;2;R;G;Bm); otherwise the 256-colour fallback (\033[38;5;Nm) is used.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // Amber is the primary accent: titles, commands, highlights, [APP]. Amber = Color{255, 182, 39, 214} // Sage is success, "ok", hints and fixes. Sage = Color{139, 175, 108, 107} // Warn is for warnings. Warn = Color{232, 131, 58, 208} // Error is for errors and failures. Error = Color{229, 83, 75, 167} // Muted is for timestamps, dim labels and separators. Muted = Color{154, 147, 132, 246} // Sand is secondary info, e.g. [PLATFORM] and the info log level. Sand = Color{217, 212, 199, 188} // Dim is a darker muted tone used for trace-level output. Dim = Color{88, 88, 88, 240} )
Functions ¶
func Enabled ¶
func Enabled() bool
Enabled reports whether colour output is allowed: NO_COLOR is unset, and either FORCE_COLOR is set or stderr is a terminal.
Types ¶
type Color ¶
Color is a palette entry with a truecolor value and a 256-colour fallback.
func (Color) Attrs ¶
Attrs returns fatih/color attributes for c's foreground, followed by extra. fatih joins attributes with ';', so the result renders as 38;5;N or 38;2;R;G;B. fatih itself handles NO_COLOR and non-TTY output, so these attributes are returned regardless of NO_COLOR.