024dc095a5
T used to silently cycle Model.activeTeamID through the caller's teams with no visible list of choices. It now opens a full picker (modelled on the existing user picker) listing every team plus "All teams", each with a stable identity colour from a new six-colour theme palette. The same colour now also shows as a bullet next to "team: <name>" in the header, so the active team stays visible without opening the picker. Adds an Identity palette to the theme package (six hues, skipping the ones that already mean firing/critical), Styles.TeamColor to pick one by team id, and identity_1..6 as theme-file tokens alongside the existing twelve so a fully custom theme can still set every token.
37 lines
1.4 KiB
Go
37 lines
1.4 KiB
Go
// Package theme resolves the named colour scheme the TUI renders with. A theme
|
|
// is a flat set of semantic tokens — roles like "muted" or "firing", never hues
|
|
// — so a new scheme is a table of colours rather than a change to the views.
|
|
package theme
|
|
|
|
import "github.com/charmbracelet/lipgloss"
|
|
|
|
// Theme is the palette the UI draws from. Every token is a foreground except
|
|
// OnPrimary, which is the text colour for the two places that invert: the
|
|
// active tab and the selected table row.
|
|
//
|
|
// Colours are truecolor hex; lipgloss downsamples them for 256- and 16-colour
|
|
// terminals and drops them entirely under NO_COLOR, so themes do not carry
|
|
// fallbacks of their own.
|
|
type Theme struct {
|
|
Name string
|
|
|
|
Primary lipgloss.Color // header, tab highlight, selection
|
|
OnPrimary lipgloss.Color // text drawn on a Primary background
|
|
Text lipgloss.Color // default emphasis foreground
|
|
Muted lipgloss.Color // secondary text, dividers, borders
|
|
Accent lipgloss.Color // status line, acknowledged, by-day chart
|
|
|
|
Firing lipgloss.Color
|
|
Resolved lipgloss.Color
|
|
Error lipgloss.Color
|
|
|
|
SevCritical lipgloss.Color
|
|
SevError lipgloss.Color
|
|
SevWarning lipgloss.Color
|
|
SevInfo lipgloss.Color
|
|
|
|
// Identity tells things like teams apart from one another — not a status
|
|
// or a severity, so none of the six carries a meaning of its own.
|
|
Identity [6]lipgloss.Color
|
|
}
|