Rename bg/fg palette keys to background/foreground

The canonical colors.toml keys are now background/foreground, including
all permutations (dark_background, darker_background, lighter_background,
dark_foreground, light_foreground, bright_foreground). The old short
names are gone entirely, not kept as aliases; legacy alacritty-generated
themes still resolve through the ANSI color0/color7 fallback.

Theme files are also regrouped: accent/selection/muted first, then the
backgrounds, then the foregrounds, then the named colors.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
David Heinemeier Hansson
2026-07-18 16:24:51 -07:00
co-authored by Claude Fable 5
parent 72d7646c64
commit afa2839a5a
46 changed files with 747 additions and 718 deletions
+3 -3
View File
@@ -141,9 +141,9 @@ sizing in `themes/<name>/shell.toml`. Defaults are generated from
`default/themed/shell.toml.tpl`; a theme may also drop a hand-written
`shell.toml` next to its `colors.toml` to replace the generated file.
`colors.toml` uses `fg` and `bg` for the foundational text/background
palette. The shell exposes those to QML as `Color.foreground` and
`Color.background`, so shell roles still use the readable role names.
`colors.toml` uses `foreground` and `background` for the foundational
text/background palette, exposed to QML as `Color.foreground` and
`Color.background`.
The shell exposes these tokens to QML via two singletons in
`qs.Commons`:
+35 -21
View File
@@ -30,36 +30,50 @@ built-in template, the built-in output is skipped.
## `colors.toml`
`colors.toml` provides the palette keys used by templates. Common keys are:
`colors.toml` provides the palette keys used by templates. Keys are grouped
semantic-first: accent/selection/muted, then the backgrounds, then the
foregrounds, then the named colors:
```toml
bg = "#1a1b26"
fg = "#a9b1d6"
accent = "#7aa2f7"
selection = "#292e42"
red = "#f7768e"
blue = "#7aa2f7"
mode = "dark"
accent = "#7aa2f7"
selection = "#292e42"
muted = "#414868"
background = "#1a1b26"
dark_background = "#13141c"
darker_background = "#0e0e14"
lighter_background = "#24283b"
foreground = "#a9b1d6"
dark_foreground = "#565f89"
light_foreground = "#b4bee6"
bright_foreground = "#c0caf5"
red = "#f7768e"
blue = "#7aa2f7"
```
Any key can be referenced from a template with `{{ key }}`. The foundational
shell palette is loaded from:
- `fg` — primary readable text color
- `bg` — primary background color
- `foreground` — primary readable text color
- `background` — primary background color
- `accent` — preferred when present; otherwise some places fall back to
`color4`
- `muted` — de-emphasized elements (comments, placeholders, dividers); also
serves as ANSI `color8`
- `urgent` / `red` / `color1`
For older user themes and templates, `foreground` aliases to `fg` and
`background` aliases to `bg`.
The neutral ramp is centered on `bg -> bright_fg`. Dark themes should read from
darkest to lightest; light themes should read from lightest to darkest. Terminal
and editor cursors use `bright_fg`; there is no separate cursor palette key.
`selection` is the text-selection background stop in that ramp; Omarchy derives
`selection_background = selection` and `selection_foreground = bright_fg`. Use
`omarchy dev theme-preview [theme]` to inspect that ramp, including `dark_bg`,
`darker_bg`, and a selected-text sample.
The neutral ramp is centered on `background -> bright_foreground`. Dark themes
should read from darkest to lightest; light themes should read from lightest to
darkest. Terminal and editor cursors use `bright_foreground`; there is no
separate cursor palette key. `selection` is the text-selection background stop
in that ramp; Omarchy derives `selection_background = selection` and
`selection_foreground = bright_foreground`. Use
`omarchy dev theme-preview [theme]` to inspect that ramp, including
`dark_background`, `darker_background`, and a selected-text sample.
## Template placeholders
@@ -82,8 +96,8 @@ For a color key such as `accent = "#7aa2f7"`:
percentage:
```text
{{ mix bg fg 15% }}
{{ mix_strip bg accent 0.35 }}
{{ mix background foreground 15% }}
{{ mix_strip background accent 0.35 }}
{{ mix_rgb color0 color7 50 }}
```