Theme file format
The TOML a theme is written in, and what each field controls.
Write a TOML file and pass its path to --theme.
name = "mine"
[dark]
fg = "#c0caf5"
bg = "#1a1b26"
ansi = ["#15161e", "#f7768e", "#9ece6a", "#e0af68", "#7aa2f7", "#bb9af7", "#7dcfff", "#a9b1d6",
"#414868", "#f7768e", "#9ece6a", "#e0af68", "#7aa2f7", "#bb9af7", "#7dcfff", "#c0caf5"]
[light]
fg = "#3760bf"
bg = "#e1e2e7"
ansi = ["#b4b5b9", "#f52a65", "#587539", "#8c6c3e", "#2e7de9", "#9854f1", "#007197", "#6172b0",
"#a1a6c5", "#f52a65", "#587539", "#8c6c3e", "#2e7de9", "#9854f1", "#007197", "#3760bf"]Fields
| Field | Required | Meaning |
|---|---|---|
name | yes | What the theme is called |
[dark] | yes | The dark palette |
[light] | no | The light palette. Left out means the theme has one look |
fg | yes | Default text color |
bg | yes | Background |
ansi | yes | Sixteen colors, see below |
cursor | no | Falls back to fg |
chrome | no | Title bar fill, falls back to bg |
border | no | Window border, falls back to bg |
buttons | no | Three colors for the window buttons |
Every color is #rrggbb.
The ansi array
Sixteen entries, the standard ANSI colors in order:
black, red, green, yellow, blue, magenta, cyan, white,then the same eight again in their bright forms.
Light is optional
A required light palette meant inventing a fake one for themes that do not have
an official light version, or not shipping the theme. Where [light] is absent
the dark palette is used for both, and the SVG leaves out the
prefers-color-scheme block rather than switching between two identical
palettes.
The window slots
cursor, chrome, border and buttons are why every theme no longer shares
one macOS window frame. All four are optional and fall back to exactly what
happened before they existed, so a theme file written against an older version
renders byte for byte as it did.
[dark]
fg = "#cdd6f4"
bg = "#1e1e2e"
cursor = "#f5e0dc"
chrome = "#181825"
border = "#313244"
buttons = ["#f38ba8", "#f9e2af", "#a6e3a1"]
ansi = [...]Checking it
ttysvg theme show ./mine.tomlThat draws both palettes and measures contrast, so a combination that would be hard to read says so before you publish a recording in it.