Skip to content

Commit 72b5004

Browse files
authored
Merge pull request #1542 from entireio/jakub-nespor/base-16-colors
Migrate all TUI colors to base16 palette
2 parents 84d5a0a + 9e2c20b commit 72b5004

20 files changed

Lines changed: 326 additions & 156 deletions

cmd/entire/cli/activity_render.go

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"time"
1212

1313
"charm.land/lipgloss/v2"
14+
"github.com/entireio/cli/cmd/entire/cli/palette"
1415
"golang.org/x/term"
1516
)
1617

@@ -63,16 +64,16 @@ func newActivityStyles(w io.Writer) activityStyles {
6364
if useColor {
6465
s.bold = lipgloss.NewStyle().Bold(true)
6566
s.dim = lipgloss.NewStyle().Faint(true)
66-
s.label = lipgloss.NewStyle().Foreground(lipgloss.Color("8")).Bold(true)
67+
s.label = lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Muted)).Bold(true)
6768
s.value = lipgloss.NewStyle().Bold(true)
68-
s.unit = lipgloss.NewStyle().Foreground(lipgloss.Color("8"))
69-
s.desc = lipgloss.NewStyle().Foreground(lipgloss.Color("8"))
70-
s.repoNm = lipgloss.NewStyle().Foreground(lipgloss.Color("7"))
71-
s.commitH = lipgloss.NewStyle().Foreground(lipgloss.Color("8"))
69+
s.unit = lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Muted))
70+
s.desc = lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Muted))
71+
s.repoNm = lipgloss.NewStyle() // default fg: inverts with terminal theme
72+
s.commitH = lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Muted))
7273
s.commitM = lipgloss.NewStyle().Bold(true)
73-
s.add = lipgloss.NewStyle().Foreground(lipgloss.Color("2"))
74-
s.del = lipgloss.NewStyle().Foreground(lipgloss.Color("1"))
75-
s.muted = lipgloss.NewStyle().Foreground(lipgloss.Color("8"))
74+
s.add = lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Success))
75+
s.del = lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Error))
76+
s.muted = lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Muted))
7677
}
7778

7879
return s
@@ -95,12 +96,17 @@ func (s activityStyles) renderAgent(agentID, text string) string {
9596

9697
type agentDisplay struct {
9798
Label string
98-
Color string // ANSI 256 color code
99+
Color string // agent brand color (hex); lipgloss resolves to the terminal's profile
99100
Char rune // block character for bar charts
100101
}
101102

102-
// Agent colors match the dark-mode CSS variables from entire.io (Tailwind 400-level).
103-
// Lipgloss resolves hex to the best representation for the terminal's color profile.
103+
// Agent colors are the per-agent brand colors from entire.io (dark-mode CSS
104+
// variables, Tailwind 400-level). This is a deliberate exception to the CLI's
105+
// base16 palette: there are more agents than base16 has distinct hues, so
106+
// collapsing them onto ANSI slots makes neighboring agents indistinguishable
107+
// in bar charts and legends. We keep the hex values so each agent stays
108+
// recognizable; lipgloss resolves them to the best representation for the
109+
// terminal's color profile. The non-brand "unknown" fallback uses muted gray.
104110
var agentDisplayMap = map[string]agentDisplay{
105111
"claude": {Label: "Claude Code", Color: "#fb923c", Char: '▓'}, // orange-400
106112
"gemini": {Label: "Gemini", Color: "#60a5fa", Char: '▓'}, // blue-400
@@ -112,7 +118,7 @@ var agentDisplayMap = map[string]agentDisplay{
112118
"cursor": {Label: "Cursor", Color: "#38bdf8", Char: '▓'}, // sky-400
113119
"droid": {Label: "Droid", Color: "#f472b6", Char: '▓'}, // pink-400
114120
"kiro": {Label: "Kiro", Color: "#c084fc", Char: '▓'}, // purple-400
115-
"unknown": {Label: "Unknown", Color: "245", Char: '░'},
121+
"unknown": {Label: "Unknown", Color: palette.Muted, Char: '░'},
116122
}
117123

118124
var agentOrder = []string{

cmd/entire/cli/activity_tui.go

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
tea "charm.land/bubbletea/v2"
1414
"charm.land/lipgloss/v2"
1515
"github.com/entireio/cli/cmd/entire/cli/api"
16+
"github.com/entireio/cli/cmd/entire/cli/palette"
1617
)
1718

1819
// activityDataMsg is sent when API data has been fetched.
@@ -54,7 +55,7 @@ type activityModel struct {
5455
func runActivityTUI(ctx context.Context, client *api.Client) error {
5556
sp := spinner.New()
5657
sp.Spinner = spinner.Dot
57-
sp.Style = lipgloss.NewStyle().Foreground(lipgloss.Color("8"))
58+
sp.Style = lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Muted))
5859

5960
m := activityModel{
6061
loading: true,
@@ -228,8 +229,8 @@ func (m activityModel) renderFooter() string {
228229
if !m.sty.colorEnabled {
229230
return ""
230231
}
231-
helpStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("241"))
232-
keyStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("245")).Bold(true)
232+
helpStyle := lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Muted)).Faint(true)
233+
keyStyle := lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Muted)).Bold(true)
233234
sep := helpStyle.Render(" · ")
234235

235236
fullHelp := keyStyle.Render("↑/↓, j/k") + helpStyle.Render(" scroll") +
@@ -272,16 +273,16 @@ func newActivityStylesWithWidth(width int, useColor bool) activityStyles {
272273
width: width,
273274
bold: lipgloss.NewStyle().Bold(true),
274275
dim: lipgloss.NewStyle().Faint(true),
275-
label: lipgloss.NewStyle().Foreground(lipgloss.Color("8")).Bold(true),
276+
label: lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Muted)).Bold(true),
276277
value: lipgloss.NewStyle().Bold(true),
277-
unit: lipgloss.NewStyle().Foreground(lipgloss.Color("8")),
278-
desc: lipgloss.NewStyle().Foreground(lipgloss.Color("8")),
279-
repoNm: lipgloss.NewStyle().Foreground(lipgloss.Color("7")),
280-
commitH: lipgloss.NewStyle().Foreground(lipgloss.Color("8")),
278+
unit: lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Muted)),
279+
desc: lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Muted)),
280+
repoNm: lipgloss.NewStyle(), // default fg: inverts with terminal theme
281+
commitH: lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Muted)),
281282
commitM: lipgloss.NewStyle().Bold(true),
282-
add: lipgloss.NewStyle().Foreground(lipgloss.Color("2")),
283-
del: lipgloss.NewStyle().Foreground(lipgloss.Color("1")),
284-
muted: lipgloss.NewStyle().Foreground(lipgloss.Color("8")),
283+
add: lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Success)),
284+
del: lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Error)),
285+
muted: lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Muted)),
285286
}
286287
}
287288

cmd/entire/cli/auth.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"charm.land/lipgloss/v2"
1515
"github.com/entireio/cli/cmd/entire/cli/api"
1616
"github.com/entireio/cli/cmd/entire/cli/auth"
17+
"github.com/entireio/cli/cmd/entire/cli/palette"
1718
"github.com/entireio/cli/internal/coreapi"
1819
"github.com/entireio/cli/internal/entireclient/contexts"
1920
"github.com/spf13/cobra"
@@ -496,8 +497,8 @@ func newAuthTableStyles(w io.Writer) authTableStyles {
496497
if !useColor {
497498
return s
498499
}
499-
s.header = lipgloss.NewStyle().Foreground(lipgloss.Color("8")).Bold(true)
500-
s.id = lipgloss.NewStyle().Foreground(lipgloss.Color("3")) // yellow
500+
s.header = lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Muted)).Bold(true)
501+
s.id = lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Warning)) // yellow
501502
s.name = lipgloss.NewStyle().Bold(true)
502503
s.value = lipgloss.NewStyle() // default fg
503504
return s

cmd/entire/cli/corecmd.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414

1515
"github.com/entireio/cli/cmd/entire/cli/auth"
1616
"github.com/entireio/cli/cmd/entire/cli/interactive"
17+
"github.com/entireio/cli/cmd/entire/cli/palette"
1718
"github.com/entireio/cli/internal/coreapi"
1819
)
1920

@@ -244,9 +245,9 @@ func newTableStyles(w io.Writer) tableStyles {
244245
}
245246
return tableStyles{
246247
enabled: true,
247-
header: lipgloss.NewStyle().Foreground(lipgloss.Color("8")).Bold(true),
248-
primary: lipgloss.NewStyle().Foreground(lipgloss.Color("7")),
249-
cell: lipgloss.NewStyle().Foreground(lipgloss.Color("8")),
248+
header: lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Muted)).Bold(true),
249+
primary: lipgloss.NewStyle(), // default fg: inverts with terminal theme
250+
cell: lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Muted)),
250251
}
251252
}
252253

cmd/entire/cli/dispatch_tui.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515

1616
dispatchpkg "github.com/entireio/cli/cmd/entire/cli/dispatch"
1717
"github.com/entireio/cli/cmd/entire/cli/mdrender"
18+
"github.com/entireio/cli/cmd/entire/cli/palette"
1819
)
1920

2021
type dispatchRenderResult struct {
@@ -138,11 +139,11 @@ func newDispatchStatusStyles(ss statusStyles) dispatchStatusStyles {
138139
return styles
139140
}
140141

141-
styles.title = styles.title.Foreground(lipgloss.Color("#fb923c"))
142-
styles.subtitle = lipgloss.NewStyle().Foreground(lipgloss.Color("245"))
143-
styles.detail = lipgloss.NewStyle().Foreground(lipgloss.Color("245"))
144-
styles.footer = lipgloss.NewStyle().Foreground(lipgloss.Color("245"))
145-
styles.spinner = lipgloss.NewStyle().Foreground(lipgloss.Color("#fb923c")).Bold(true)
142+
styles.title = styles.title.Foreground(lipgloss.Color(palette.Accent))
143+
styles.subtitle = lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Muted))
144+
styles.detail = lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Muted))
145+
styles.footer = lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Muted))
146+
styles.spinner = lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Accent)).Bold(true)
146147
return styles
147148
}
148149

cmd/entire/cli/experts_cmd.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
"github.com/entireio/cli/cmd/entire/cli/api"
1818
"github.com/entireio/cli/cmd/entire/cli/gitremote"
1919
"github.com/entireio/cli/cmd/entire/cli/interactive"
20+
"github.com/entireio/cli/cmd/entire/cli/palette"
2021
"github.com/entireio/cli/cmd/entire/cli/paths"
2122
"github.com/spf13/cobra"
2223
)
@@ -150,13 +151,13 @@ func expertsStylesForColor(useColor bool) expertsStyles {
150151
return styles
151152
}
152153

153-
styles.title = lipgloss.NewStyle().Foreground(lipgloss.Color("#fb923c")).Bold(true)
154-
styles.agent = lipgloss.NewStyle().Foreground(lipgloss.Color("#fb923c")).Bold(true)
155-
styles.label = lipgloss.NewStyle().Foreground(lipgloss.Color("#22d3ee"))
156-
styles.facet = lipgloss.NewStyle().Foreground(lipgloss.Color("#818cf8"))
157-
styles.muted = lipgloss.NewStyle().Foreground(lipgloss.Color("8"))
158-
styles.file = lipgloss.NewStyle().Foreground(lipgloss.Color("#22d3ee"))
159-
styles.bullet = lipgloss.NewStyle().Foreground(lipgloss.Color("#fb923c"))
154+
styles.title = lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Accent)).Bold(true)
155+
styles.agent = lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Accent)).Bold(true)
156+
styles.label = lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Info))
157+
styles.facet = lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Blue))
158+
styles.muted = lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Muted))
159+
styles.file = lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Info))
160+
styles.bullet = lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Accent))
160161
return styles
161162
}
162163

cmd/entire/cli/experts_test.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"testing"
1414

1515
"charm.land/lipgloss/v2"
16+
"github.com/entireio/cli/cmd/entire/cli/palette"
1617
"github.com/entireio/cli/cmd/entire/cli/paths"
1718
)
1819

@@ -212,13 +213,13 @@ func TestRenderExpertsWithStylesUsesEntirePalette(t *testing.T) {
212213

213214
styles := expertsStyles{
214215
colorEnabled: true,
215-
title: lipgloss.NewStyle().Foreground(lipgloss.Color("#fb923c")).Bold(true),
216-
agent: lipgloss.NewStyle().Foreground(lipgloss.Color("#fb923c")).Bold(true),
217-
label: lipgloss.NewStyle().Foreground(lipgloss.Color("#22d3ee")),
218-
facet: lipgloss.NewStyle().Foreground(lipgloss.Color("#818cf8")),
219-
muted: lipgloss.NewStyle().Foreground(lipgloss.Color("8")),
220-
file: lipgloss.NewStyle().Foreground(lipgloss.Color("#22d3ee")),
221-
bullet: lipgloss.NewStyle().Foreground(lipgloss.Color("#fb923c")),
216+
title: lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Accent)).Bold(true),
217+
agent: lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Accent)).Bold(true),
218+
label: lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Info)),
219+
facet: lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Blue)),
220+
muted: lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Muted)),
221+
file: lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Info)),
222+
bullet: lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Accent)),
222223
}
223224

224225
var out bytes.Buffer

cmd/entire/cli/experts_tui.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import (
1111
tea "charm.land/bubbletea/v2"
1212
"charm.land/lipgloss/v2"
1313
xansi "github.com/charmbracelet/x/ansi"
14+
15+
"github.com/entireio/cli/cmd/entire/cli/palette"
1416
)
1517

1618
// Layout budget for the experts viewer. The header is a single title line
@@ -43,12 +45,12 @@ func newExpertsTUIStyles(useColor bool) expertsTUIStyles {
4345
if !useColor {
4446
return s
4547
}
46-
s.selected = lipgloss.NewStyle().Foreground(lipgloss.Color("#fb923c")).Bold(true)
47-
s.section = lipgloss.NewStyle().Foreground(lipgloss.Color("#fb923c")).Bold(true)
48-
s.helpKey = lipgloss.NewStyle().Foreground(lipgloss.Color("245")).Bold(true)
49-
s.helpDesc = lipgloss.NewStyle().Foreground(lipgloss.Color("241"))
50-
s.helpSep = lipgloss.NewStyle().Foreground(lipgloss.Color("241"))
51-
s.sepBar = lipgloss.NewStyle().Foreground(lipgloss.Color("8"))
48+
s.selected = lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Accent)).Bold(true)
49+
s.section = lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Accent)).Bold(true)
50+
s.helpKey = lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Muted)).Bold(true)
51+
s.helpDesc = lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Muted)).Faint(true)
52+
s.helpSep = lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Muted)).Faint(true)
53+
s.sepBar = lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Muted))
5254
return s
5355
}
5456

cmd/entire/cli/explain.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"github.com/entireio/cli/cmd/entire/cli/checkpoint/id"
2626
"github.com/entireio/cli/cmd/entire/cli/interactive"
2727
"github.com/entireio/cli/cmd/entire/cli/logging"
28+
"github.com/entireio/cli/cmd/entire/cli/palette"
2829
"github.com/entireio/cli/cmd/entire/cli/paths"
2930
"github.com/entireio/cli/cmd/entire/cli/settings"
3031
"github.com/entireio/cli/cmd/entire/cli/strategy"
@@ -1770,9 +1771,9 @@ func formatCheckpointHeader(
17701771

17711772
headline := "● Checkpoint " + cpID.String()
17721773
if styles.colorEnabled {
1773-
bullet := styles.render(lipgloss.NewStyle().Foreground(lipgloss.Color("#fb923c")), "●")
1774+
bullet := styles.render(lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Accent)), "●")
17741775
key := styles.render(styles.bold, "Checkpoint")
1775-
val := styles.render(lipgloss.NewStyle().Foreground(lipgloss.Color("#fb923c")), cpID.String())
1776+
val := styles.render(lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Accent)), cpID.String())
17761777
headline = bullet + " " + key + " " + val
17771778
}
17781779
sb.WriteString(headline)
@@ -2709,7 +2710,7 @@ func groupByCheckpointID(points []strategy.RewindPoint) []checkpointGroup {
27092710
}
27102711

27112712
// formatCheckpointGroup formats a single checkpoint group for display.
2712-
// The list view headline puts the checkpoint ID first (in bold orange),
2713+
// The list view headline puts the checkpoint ID first (in bold accent/magenta),
27132714
// followed by indicators and the prompt — which cascades from
27142715
// SessionPrompt → latest commit message → dimmed `(no prompt recorded)`.
27152716
func formatCheckpointGroup(sb *strings.Builder, group checkpointGroup, styles statusStyles) {

cmd/entire/cli/investigate/tui_model.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
tea "charm.land/bubbletea/v2"
1212
"charm.land/lipgloss/v2"
1313

14+
"github.com/entireio/cli/cmd/entire/cli/palette"
1415
"github.com/entireio/cli/cmd/entire/cli/tuiutil"
1516
)
1617

@@ -108,7 +109,7 @@ type investigateTUIModel struct {
108109
func newInvestigateTUIModel(topic, runID string, agents []string, maxTurns, quorum int, cancel context.CancelFunc) investigateTUIModel {
109110
sp := spinner.New()
110111
sp.Spinner = spinner.Dot
111-
sp.Style = lipgloss.NewStyle().Foreground(lipgloss.Color("8"))
112+
sp.Style = lipgloss.NewStyle().Foreground(lipgloss.Color(palette.Muted))
112113

113114
rows := make([]agentRow, len(agents))
114115
rowIdx := make(map[string]int, len(agents))

0 commit comments

Comments
 (0)