diff options
| author | user <user@clank> | 2026-09-22 12:17:33 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-09-22 12:17:33 +0200 |
| commit | e18976b315baeb8914970bd8e54887cdb05faefc (patch) | |
| tree | dbb1936c615d7a8682531c5426bbec1ae14baf45 | |
| parent | tabs: a plate under the ones you are not in (tab_idle_bg) (diff) | |
| download | slosh-e18976b315baeb8914970bd8e54887cdb05faefc.tar.gz slosh-e18976b315baeb8914970bd8e54887cdb05faefc.tar.xz slosh-e18976b315baeb8914970bd8e54887cdb05faefc.zip | |
tabs: idle tabs you can actually read across the room
Seen next to the accent, the first plate was too polite to do the job it was
added for: a 30% lift off the background under labels in the same #45454a the
idle frames use. From another monitor the strip still read as one dark band
with a blue block in it.
Both ends move. tab_idle leaves the ambient chrome grey and becomes #8a8a95,
because a tab you are not in is a place to go and has to be legible at a
glance, where a dimmed pane border only has to be findable. The plate follows
it to 43%, which is not a taste constant but a contrast ratio: the same step
taken from a dark background upward and a light one downward lands at about
1.9:1 either way, so paper's #bdbebe on near-white and the default's #3b3b40
on black are the same amount of plate.
The six themes in contrib named their idle tab colour as their frame grey, so
each gets the same move in its own family -- 40% of the way from that grey to
the colour the theme writes text in -- and their plates follow by derivation:
amber #a67c26, mono #909090, paper #666a6e, phosphor #4a9c5d, slate #70789c,
sl0p the house #8a8a95. Nobody who named a colour loses it; the derivation
only ever fills in a theme's silence.
| -rw-r--r-- | config/config.kdl | 17 | ||||
| -rw-r--r-- | contrib/themes/amber.kdl | 2 | ||||
| -rw-r--r-- | contrib/themes/default.kdl | 2 | ||||
| -rw-r--r-- | contrib/themes/mono.kdl | 2 | ||||
| -rw-r--r-- | contrib/themes/paper.kdl | 2 | ||||
| -rw-r--r-- | contrib/themes/phosphor.kdl | 2 | ||||
| -rw-r--r-- | contrib/themes/sl0p.kdl | 2 | ||||
| -rw-r--r-- | contrib/themes/slate.kdl | 2 | ||||
| -rw-r--r-- | docs/panes.md | 10 | ||||
| -rw-r--r-- | include/config.h | 9 | ||||
| -rw-r--r-- | src/config.c | 27 | ||||
| -rw-r--r-- | tests/test_tabs.py | 4 |
12 files changed, 48 insertions, 33 deletions
diff --git a/config/config.kdl b/config/config.kdl index d4d5efe..fc6fb3b 100644 --- a/config/config.kdl +++ b/config/config.kdl @@ -843,14 +843,17 @@ theme { tab_active_fg "#141418" tab_active_bg "#7aa2f7" tab_active_hover_fg "#ffffff" - tab_idle "#45454a" - // Every other tab is a plate too, a third of the way from the background - // to the grey above: a tab with edges rather than a word floating on the + // Brighter than the grey on idle frames and titles: a tab you are not in + // is a place to go, and has to read from across the screen. + tab_idle "#8a8a95" + // Every other tab is a plate too, 43% of the way from the background to + // the grey above: a tab with edges rather than a word floating on the // background, and something for the active fill to be brighter *than*. - // Unset, it is mixed from those two, so a theme gets one in its own - // family without naming it. Name your own background here for the bare - // strip this had before. - tab_idle_bg "#141416" + // That fraction is a contrast ratio in disguise -- about 1.9:1 against + // the background whether the theme is dark or light. Unset, it is mixed + // from those two, so a theme gets one in its own family without naming + // it. Name your own background here for bare tabs. + tab_idle_bg "#3b3b40" tab_hover "#7aa2f7" prefix_fg "#141418" // the "C-a" badge, while the prefix is pending prefix_bg "#7aa2f7" diff --git a/contrib/themes/amber.kdl b/contrib/themes/amber.kdl index e2affb7..8b43e22 100644 --- a/contrib/themes/amber.kdl +++ b/contrib/themes/amber.kdl @@ -36,7 +36,7 @@ theme { tab_active_fg "#1a1000" tab_active_bg "#ffb000" tab_active_hover_fg "#ffe0a0" - tab_idle "#6b4a00" + tab_idle "#a67c26" tab_hover "#ffb000" prefix_fg "#1a1000" prefix_bg "#ffb000" diff --git a/contrib/themes/default.kdl b/contrib/themes/default.kdl index affc02d..5924e82 100644 --- a/contrib/themes/default.kdl +++ b/contrib/themes/default.kdl @@ -42,7 +42,7 @@ theme { tab_active_fg "#141418" tab_active_bg "#7aa2f7" tab_active_hover_fg "#ffffff" - tab_idle "#45454a" + tab_idle "#8a8a95" tab_hover "#7aa2f7" prefix_fg "#141418" prefix_bg "#7aa2f7" diff --git a/contrib/themes/mono.kdl b/contrib/themes/mono.kdl index d7b70ff..48cd5ca 100644 --- a/contrib/themes/mono.kdl +++ b/contrib/themes/mono.kdl @@ -36,7 +36,7 @@ theme { tab_active_fg "#101010" tab_active_bg "#e4e4e4" tab_active_hover_fg "#ffffff" - tab_idle "#585858" + tab_idle "#909090" tab_hover "#e4e4e4" prefix_fg "#101010" prefix_bg "#e4e4e4" diff --git a/contrib/themes/paper.kdl b/contrib/themes/paper.kdl index 7fd1f5e..3fef814 100644 --- a/contrib/themes/paper.kdl +++ b/contrib/themes/paper.kdl @@ -36,7 +36,7 @@ theme { tab_active_fg "#ffffff" tab_active_bg "#0057b8" tab_active_hover_fg "#1a1a1a" - tab_idle "#9aa0a6" + tab_idle "#666a6e" tab_hover "#0057b8" prefix_fg "#ffffff" prefix_bg "#0057b8" diff --git a/contrib/themes/phosphor.kdl b/contrib/themes/phosphor.kdl index 92c0705..5af1125 100644 --- a/contrib/themes/phosphor.kdl +++ b/contrib/themes/phosphor.kdl @@ -36,7 +36,7 @@ theme { tab_active_fg "#04140a" tab_active_bg "#33ff66" tab_active_hover_fg "#b9ffcc" - tab_idle "#1f5b32" + tab_idle "#4a9c5d" tab_hover "#33ff66" prefix_fg "#04140a" prefix_bg "#33ff66" diff --git a/contrib/themes/sl0p.kdl b/contrib/themes/sl0p.kdl index ad3431e..f421bac 100644 --- a/contrib/themes/sl0p.kdl +++ b/contrib/themes/sl0p.kdl @@ -36,7 +36,7 @@ theme { tab_active_fg "#141418" tab_active_bg "#ff5fd7" tab_active_hover_fg "#ffffff" - tab_idle "#45454a" + tab_idle "#8a8a95" tab_hover "#ff5fd7" prefix_fg "#141418" prefix_bg "#ff5fd7" diff --git a/contrib/themes/slate.kdl b/contrib/themes/slate.kdl index 5df850f..d5f3fb9 100644 --- a/contrib/themes/slate.kdl +++ b/contrib/themes/slate.kdl @@ -36,7 +36,7 @@ theme { tab_active_fg "#11131c" tab_active_bg "#7aa2f7" tab_active_hover_fg "#c0caf5" - tab_idle "#3b4261" + tab_idle "#70789c" tab_hover "#7aa2f7" prefix_fg "#11131c" prefix_bg "#7aa2f7" diff --git a/docs/panes.md b/docs/panes.md index 087c873..6062280 100644 --- a/docs/panes.md +++ b/docs/panes.md @@ -127,9 +127,13 @@ terminal's own background alone. The top strip has one row and no room for any o why the sidebar exists. **Every tab is a plate, not a word on the background.** The one you are in is -filled with the accent (`tab_active_bg`); the rest sit on `tab_idle_bg`, a -third of the way from the theme's background to the grey it writes idle labels -in. Two things come of the quiet fill: a tab has edges, so where one ends, how +filled with the accent (`tab_active_bg`); the rest sit on `tab_idle_bg`, 43% of +the way from the theme's background to `tab_idle`, the grey it writes their +labels in — a fraction chosen as a contrast ratio, about 1.9:1 against the +background whether the theme is dark or light. That label grey is brighter than +the one on idle frames and titles, because a tab you are not in is a place to +go and has to read from across the screen, where a dimmed border only has to be +findable. Two things come of the quiet fill: a tab has edges, so where one ends, how far the row you are about to click reaches, and — in the sidebar especially — which rows are tabs rather than statuses are all visible; and the active fill has something to be brighter *than*, which on a strip of short labels is most diff --git a/include/config.h b/include/config.h index a042141..e24817a 100644 --- a/include/config.h +++ b/include/config.h @@ -471,10 +471,11 @@ typedef struct { /* The fill under every tab that is not the active one, so a tab reads as a * plate rather than as words floating on the background -- and so the * active tab's fill reads as *this one* against the rest, which is a - * comparison it could not make against nothing. Derived a third of the way - * from the background to `tab_idle`, the tab's own label grey, so it stays - * in a theme's family without any theme naming it. Set it to the theme's - * `default_bg` for the old bare look. */ + * comparison it could not make against nothing. Derived 43% of the way from + * the background to `tab_idle`, the tab's own label grey, so it stays in a + * theme's family without any theme naming it -- and lands at about the same + * 1.9:1 against the background whether that background is dark or light. + * Set it to the theme's `default_bg` for the bare look. */ color_t tab_idle_bg; color_t prefix_fg, prefix_bg; /* the "C-a" badge */ color_t tab_count; /* how many panes in the session */ diff --git a/src/config.c b/src/config.c index d729287..d2b89b7 100644 --- a/src/config.c +++ b/src/config.c @@ -1058,14 +1058,21 @@ void config_defaults(config_t *c) { c->tab_active_fg = ink; c->tab_active_bg = accent; c->tab_active_hover_fg = bright; - c->tab_idle = dim; - /* A plate under the tabs you are not in. Barely off the background and in - * the label's own grey: enough that a tab is a shape with edges, not enough - * to compete with the active tab's accent fill -- the strip has one - * highlight and this is not it. It also gives the active fill something to - * be brighter *than*, which on a strip of short labels is most of how the - * eye finds it. */ - c->tab_idle_bg = blend(c->default_bg, dim, 30); + /* Brighter than the ambient chrome grey the rest of the idle furniture uses + * (`dim`, on frames and titles): a tab you are not in is a place to go, and + * has to be readable at a glance from across the screen, where a dimmed + * pane border only has to be findable. */ + c->tab_idle = rgb(0x8a, 0x8a, 0x95); + /* A plate under the tabs you are not in, in the label's own grey. Enough + * that a tab is a shape with edges rather than a word on the background, + * and enough to give the active fill something to be brighter *than* -- + * which on a strip of short labels is most of how the eye finds the tab it + * is in -- while staying a plate rather than a second highlight. The + * fraction is a contrast ratio in disguise: 43% of the way from the + * background to the label lands about 1.9:1 against that background whether + * the theme is black-on-dark or white-on-light, because the same step is + * being taken in opposite directions. */ + c->tab_idle_bg = blend(c->default_bg, c->tab_idle, 43); c->tab_hover = accent; c->prefix_fg = ink; c->prefix_bg = accent; @@ -2493,13 +2500,13 @@ static bool load_into(config_t *c, const char *path, int depth, char *err, * split apply_scrolled makes. */ if (!kdl_child(theme, "tab_status_fg")) c->tab_status_fg = blend(c->tab_count, c->tab_hover, 40); - /* The idle tab plate, on the same terms: a third of the way from the + /* The idle tab plate, on the same terms: 43% of the way from the * theme's background to the grey it writes idle tab labels in. Every * theme defines both, so each gets a plate in its own family -- paper * lightens, phosphor greens -- and a theme that wants the bare strip back * says `tab_idle_bg` in its own default_bg rather than editing this. */ if (!kdl_child(theme, "tab_idle_bg")) - c->tab_idle_bg = blend(c->default_bg, c->tab_idle, 30); + c->tab_idle_bg = blend(c->default_bg, c->tab_idle, 43); /* The alternate band, on the same terms. A tenth of the way from the * tab bar's own background toward the accent: enough to read as a * different row at a glance, not enough to read as a highlight. */ diff --git a/tests/test_tabs.py b/tests/test_tabs.py index 09b1eec..92a35c5 100644 --- a/tests/test_tabs.py +++ b/tests/test_tabs.py @@ -312,8 +312,8 @@ def test_json_api(): ACCENT = "#7aa2f7" # the fill of the tab you are in, and hover on the rest INK = "#141418" # text on that fill BRIGHT = "#ffffff" # that text while the pointer is on it -DIM = "#45454a" # a tab you are not in -IDLE_BG = "#141416" # ...and its plate: a third of the way from bg to DIM +DIM = "#8a8a95" # a tab you are not in +IDLE_BG = "#3b3b40" # ...and its plate: 43% of the way from bg to DIM def two_tab_layout(): |
