Documentation
¶
Index ¶
Constants ¶
const ( IconOK = "✓" IconWarn = "⚠" IconFail = "✗" )
Status icons. Keep these in one place so prompts, results, and JSON-text fallbacks all reach for the same glyph.
Variables ¶
var ( ColorAccent = lipgloss.Color("205") // pink — focused input ColorSecondary = lipgloss.Color("179") // gold — secondary labels (e.g. scope in a title) ColorRunning = lipgloss.Color("39") // blue — in-progress state ColorSuccess = lipgloss.Color("42") // green — completed actions ColorError = lipgloss.Color("196") // red — failures ColorWarning = lipgloss.Color("220") // yellow — warnings, "press Y to confirm" ColorMuted = lipgloss.Color("244") // gray — footer hints, less important text )
Semantic color tokens. Use these instead of raw lipgloss.Color values so every widget speaks the same visual language, and a future palette swap only has to touch this file.
256-color codes are used (not hex) so terminals with reduced color depth degrade gracefully instead of falling back to white.
var ( // TitleStyle is for prompt headings and emphasized labels. Bold, no color // so it works across light and dark terminals. TitleStyle = lipgloss.NewStyle().Bold(true) // AccentStyle is for active or in-progress UI: the spinner glyph, the // focused-input cursor accent, anything the user's eye should track. AccentStyle = lipgloss.NewStyle().Foreground(ColorAccent) // SecondaryStyle is for a secondary label that should read as distinct from // the primary accent without competing with it — e.g. the active scope // "(main branch)" appended to a picker title. SecondaryStyle = lipgloss.NewStyle().Foreground(ColorSecondary) // RunningStyle marks in-progress state (e.g. a running job's status glyph), // distinct from the pink accent used for focus/spinner. RunningStyle = lipgloss.NewStyle().Foreground(ColorRunning) // HelperStyle is for de-emphasized hint text — footers like // "(esc to quit)", inline shortcuts, secondary instructions. HelperStyle = lipgloss.NewStyle().Foreground(ColorMuted) // SuccessStyle / ErrorStyle / WarningStyle are for status glyphs and // short status words. Pair them with the icons below. SuccessStyle = lipgloss.NewStyle().Foreground(ColorSuccess) ErrorStyle = lipgloss.NewStyle().Foreground(ColorError) WarningStyle = lipgloss.NewStyle().Foreground(ColorWarning) NoColorStyle = lipgloss.NewStyle().Foreground(lipgloss.NoColor{}) // SearchMatchStyle highlights every pager search hit; SearchSelectedStyle // marks the one the viewport is currently scrolled to (like the focused // match in less). Dark text on a colored background keeps hits legible // regardless of the underlying syntax color. SearchMatchStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("232")).Background(ColorWarning) SearchSelectedStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("232")).Background(ColorAccent) )
Style presets that combine the colors above with shared layout choices (bold/margins/etc). Widgets should reach for these before declaring a local style; only fork into a one-off style when the preset genuinely doesn't fit.
var SeriesStyles = []lipgloss.Style{ RunningStyle, SuccessStyle, AccentStyle, SecondaryStyle, ErrorStyle, }
SeriesStyles are the colors for telling apart data series overlaid on one chart, in the order they should be handed out. They are the semantic tokens above, reused for a purpose that has no semantics of its own — the only thing that matters is that adjacent entries are easy to tell apart, including for the most common forms of color blindness, which is why the blue/green/pink run leads and red comes last.
There are deliberately only five. Beyond that, colors stop being reliably distinguishable and a caller is better off drawing separate charts than stacking more lines onto one.
Functions ¶
func SeriesStyle ¶ added in v1.0.48122
SeriesStyle returns the style for series i, cycling once the palette is exhausted so an out-of-range index still renders rather than panicking. Two series sharing a color is a presentation compromise; a crash is not.
Types ¶
This section is empty.