Lokyr
Documentation

Making a theme

On this page

A theme of Lokyr is a small TOML file of colors: the terminal's background, text and 16 colors, and, if you like, any of the interface's colors, as the tab bar's, the panels' and the find bar's. A theme is for one appearance, light or dark; Lokyr colors every interface color that it leaves out of a rule of its terminal's colors and of the other interface colors, so that a theme of the terminal's colors alone colors all of Lokyr, and a theme's accent colors whatever is of the accent. Lokyr also reads iTerm2's .itermcolors files as they are: Using an iTerm2 theme tells where to put them.

A theme gives colors alone: the tab bar's look and place, the fonts, the padding and the rest stay in your config, as the config guide tells.

Using an iTerm2 theme

Lokyr reads iTerm2's .itermcolors files as they are, without converting them: a theme of the iTerm2-Color-Schemes collection, or one that a theme's site offers for iTerm2, works in Lokyr as you download it.

First look whether Lokyr already has it: it holds 278 themes of that collection, as Dracula, Catppuccin Mocha, Nord or TokyoNight Day, which View › Choose Theme… lists with the others.

1. Put the file in Lokyr's themes folder:

~/.config/lokyr/themes/

Where XDG_CONFIG_HOME is set, the folder is $XDG_CONFIG_HOME/lokyr/themes/. View › Open Themes Folder, which the command palette runs too, opens it in the Finder, making it first if it is not there, so that the file can be dragged in. From a terminal:

mkdir -p ~/.config/lokyr/themes
cp ~/Downloads/Nightfall.itermcolors ~/.config/lokyr/themes/

Or let Lokyr copy it: double-click the file in the Finder, or drop it on Lokyr's icon in the Dock, and choose Install, which copies it into the folder, or Install and Use, which also makes it the theme of its appearance. Where another app opens .itermcolors files, open it with Lokyr from the Finder's Open With menu.

2. Choose it. The theme's name is the file's, without .itermcolors: Nightfall.itermcolors is Nightfall. Choose it in View › Choose Theme…, or name it in your config for the appearance that it is for:

[theme]
dark = "Nightfall"

Lokyr applies it as you save the file, in the windows that are open too. A file of colors for both appearances, of keys ending in (Light) and (Dark), gives two themes, Nightfall (Light) and Nightfall (Dark). A light theme shows while Lokyr is light, and a dark one while it is dark, as macOS is unless View › Appearance chooses: the picker lists the themes of the appearance in force, and Install's question offers to switch Lokyr's appearance where the theme is of the other one.

How Lokyr reads the file's colors is told in How Lokyr reads .itermcolors.

The smallest theme

[theme]
name = "Harbor"
variant = "dark"

[terminal]
background = "#14181f"
foreground = "#d8dee9"
palette = [
    "#3b4252", "#e06c75", "#98c379", "#e5c07b", "#61afef", "#c678dd", "#56b6c2", "#d8dee9",
    "#4c566a", "#ef8a91", "#b5e09a", "#f3d28a", "#86c3ff", "#d79bea", "#7fd0db", "#eceff4",
]

Save it as Harbor.toml in Lokyr's themes folder, ~/.config/lokyr/themes/ ($XDG_CONFIG_HOME/lokyr/themes/ where that variable is set), and name it in your config:

[theme]
dark = "Harbor"

Lokyr applies it as you save either file, in the windows that are open too. A file with an error tells it in a card at the windows' top right, of its line, and the theme in force stays.

example.toml is a theme of every key and every color that this guide tells, of the values of Lokyr's own dark theme: copy it and change what you like.

To start from Lokyr's own values, New… on the settings window's Themes page makes a theme of every key of Lokyr Light or Lokyr Dark, as the page shows, the terminal's optional keys as comments of their defaults, and the interface colors that it leaves to their rules as comments of the rules, which a line uncommented gives. To start from a theme that you like, View › New Theme from Current… makes a new theme of every color of the one in force, and Duplicate… in the context menu of a theme's card on the settings window's Themes page of that theme: Lokyr asks its name, writes it whole into the themes folder, themes/<name>.toml, the interface colors that it leaves out as comments of their rules, of the original's author, license and source, uses it for its appearance and opens it in your editor, where each save shows at once. A name that a theme has already, of the folder, of Lokyr's own or built in, is refused.

Installing and choosing a theme

The file

A theme's file is TOML of sections, of 1 MiB at most, as an .itermcolors file is. Colors are #rrggbb, or #rrggbbaa of an opacity, in sRGB.

[theme]

KeyWhat it is
nameIts name, for people: Lokyr knows a theme by its file's name, without .toml, which the config and the picker use
variant"light" or "dark": the appearance that it is for; without it, light where its background is lighter than its text
extendsThe name of a theme whose colors it takes where it gives none: a file's, one of the collection or a built-in one, eight deep at most
author, license, sourceWho made it, its license as an SPDX expression, and where it comes from: they tell people, and color nothing

[terminal]

KeyWhat it colorsWithout it
backgroundThe terminal's default backgroundNeeded, of the theme or of the theme that it extends
foregroundThe terminal's default textNeeded, likewise
paletteThe 16 colors, black, red, green, yellow, blue, magenta, cyan and white, then their bright onesNeeded, likewise
cursorThe cursorThe text's color
selectionThe selection's backgroundThe token field.selection
selection-textThe selected textThe text's own color
boldBold text of the default colorIts own color
underlineAn underline's colorThe text's color
cursor-text, linkThe text under a block cursor, and a link's colorRead, and not applied yet

The interface's colors

The interface's colors are tokens, each by its name, as panel.bg or tabs.active.fg. They color the terminals' windows: the tab bar, the panels, the find bar and the plugins' views in them. The settings window takes no theme: it is of Lokyr Light or Lokyr Dark, by the appearance, so that a theme being edited never colors the page that edits it. A theme gives a token in the section of its name's first part, of the rest of its name, or in [interface] by its whole name:

[tabs]
active.bg = "#2b3240"          # the token tabs.active.bg
active = { fg = "#ffffff" }    # tabs.active.fg, as TOML's tables have it

[interface]
"panel.bg" = "#1c212b"
"accent" = "#61afef"

Colors of other colors

A token's value is a color, or an expression of other colors, which follows them as they change:

[interface]
"accent" = "#c678dd"
"focus.ring" = "accent / 40%"                      # the accent at 40%
"tooltip.bg" = "mix(background, foreground, 8%)"   # the background, 8% toward the text
"list.selection.fg" = "contrasting(list.selection.bg)"

An expression that does not read, a name of no color, and tokens that name each other, as button.bg of button.hover.bg and button.hover.bg of button.bg, are told in the card, of their line, the token taking its rule's color; the rest of the theme is in force.

An expression is 512 bytes at most, its functions nested 16 deep at most; tokens that name each other go 32 deep at most; and a file gives 512 tokens at most, those past it told and left out.

The tokens

Each token, what it colors, and its rule, the color that it takes where a theme gives none, of the terms that Colors of other colors tells. A token of two rules has one of a light theme and one of a dark one, a theme dark where its background is darker than its text.

TokenWhat it colorsIts rule
textThe interface's textforeground
text.secondaryFainter text, as a count or a hintreadable(mix(text, background, 38%), on: panel.bg)
text.disabledThe text of what is dimmedmix(text, background, 62%)
text.successText that tells that something works or went well, as a plugin's state, activereadable(green, on: background)
text.warningText that tells that something does not work or needs a look, as a plugin's state, disabledreadable(yellow, on: background)
accentThe accent: what is chosen, focused or runningfirst(blue, bright-blue, foreground, on: background, at: 3)
separatorThe lines between groupstext / 10%
pane.dividerThe lines between split panestext / 16%
pane.dropThe half of a pane that a dragged tab lightslight accent / 25%, dark accent / 30%
pane.gapThe window's background between the panes' cards and around them, in a tab of more than one pane · Since 1.7light mix(background, foreground, 7%), dark mix(background, #000000, 50%)
pane.card.borderThe rim along the inside of each pane's card, brighter along its top and bottom edges in the dark appearance · Since 1.7light text / 12%, dark text / 16%
pane.card.focusThe rim of the card of the pane that has the keyboard · Since 1.7light text / 24%, dark text / 34%
pane.card.outlineThe line round each pane's card, outside it · Since 1.7light #000000 / 6%, dark #000000 / 50%
pane.card.bg.inactiveThe background of the cards of the panes that have not the keyboard, toward the gap · Since 1.7light mix(background, pane.gap, 30%), dark mix(background, pane.gap, 40%)
broadcast.ringThe ring round each pane that takes its window's broadcast of the typed input · Since 1.5red
shadowThe shadows under panelslight #000000 / 25%, dark #000000 / 50%
panel.bgThe panels' background: the find bar, the palette, the menuslight mix(background, foreground, 4%), dark mix(background, foreground, 6%)
panel.borderThe panels' borderlight text / 14%, dark text / 12%
field.bgThe text fields' backgroundbackground
field.borderThe text fields' borderlight text / 18%, dark text / 16%
field.focusA text field's border as it has the keyboardlight accent / 50%, dark accent / 60%
field.selectionA text field's selected text, and the terminal's selection where the theme gives nonelight mix(background, accent, 30%), dark mix(background, accent, 40%)
focus.ringThe ring of the keyboard's focuslight accent / 50%, dark accent / 60%
button.bgA button at restlight text / 6%, dark text / 8%
button.hover.bgA button under the pointerlight text / 8%, dark text / 10%
button.pressed.bgA button pressedlight text / 16%, dark text / 18%
button.default.bgA view's default button, which Return presses, of a deeper accent in the dark, so that white reads on it · Since 1.4light accent, dark mix(accent, #000000, 30%)
button.default.pressed.bgA default button pressed · Since 1.4mix(button.default.bg, #000000, 15%)
button.default.fgA default button's label · Since 1.4contrasting(button.default.bg)
button.destructive.fgA destructive button's label, as Remove's · Since 1.4readable(red, on: panel.bg)
toggle.on.bgA toggle that is onlight accent / 12%, dark accent / 20%
toggle.on.fgThe mark of a toggle that is onaccent
switch.off.bgA switch's track that is off · Since 1.4text / 10%
switch.on.bgA switch's track that is on · Since 1.4accent
switch.knob.bgA switch's knob · Since 1.4#ffffff
check.off.bgA checkbox's box, and a radio button's circle, that is off · Since 1.4text / 10%
check.off.pressed.bgA checkbox's box pressed while it is off · Since 1.4text / 19%
check.on.bgA checkbox's box, and a radio button's circle, that is on, of the default button's fill · Since 1.4button.default.bg
check.on.pressed.bgA checkbox's box pressed while it is on or mixed · Since 1.4mix(check.on.bg, #000000, 10%)
check.markA checkbox's check, and a radio button's dot · Since 1.4button.default.fg
group.bgA group box's fill, of grouped rows, as a settings page's · Since 1.4text / 3%
group.separatorThe hairline between a group box's rows · Since 1.4text / 5%
keycap.bgA key cap's fill, of a shortcut drawn as key caps · Since 1.4text / 8%
keycap.fgA key cap's symbol · Since 1.4text.secondary
callout.info.bgA callout's and a tag's fill, of something to know · Since 1.4accent / 12%
callout.info.fgA callout's icon and a tag's text, of something to know · Since 1.4accent
callout.success.bgA callout's and a tag's fill, of something that went well · Since 1.4text.success / 12%
callout.success.fgA callout's icon and a tag's text, of something that went well · Since 1.4text.success
callout.warning.bgA callout's and a tag's fill, of something to look at · Since 1.4text.warning / 12%
callout.warning.fgA callout's icon and a tag's text, of something to look at · Since 1.4text.warning
callout.error.bgA callout's and a tag's fill, of something that failed · Since 1.4progress.error / 12%
callout.error.fgA callout's icon and a tag's text, of something that failed · Since 1.4progress.error
switch.knob.shadowThe shadow under a switch's knob · Since 1.4light #0000001f, dark transparent
tooltip.bgThe tooltips' backgroundlight mix(background, foreground, 3%), dark mix(background, foreground, 10%)
tooltip.fgThe tooltips' texttext
tooltip.borderThe tooltips' bordertext / 15%
list.selection.bgA list's selected row, as the palette'saccent
list.selection.fgThe text of a list's selected rowcontrasting(list.selection.bg)
list.selection.inactive.bgA selected row of a list that has not the keyboardlight text / 10%, dark text / 12%
scrollbarThe scroll barlight text / 30%, dark text / 35%
scrollbar.hoverThe scroll bar under the pointerlight text / 50%, dark text / 55%
scrollbar.trackThe scroll bar's tracklight text / 5%, dark text / 7%
scrollbar.markThe find's marks beside the scroll baryellow
scrollbar.mark.currentThe current match's mark beside the scroll barmix(yellow, red, 50%)
progress.trackThe track of a program's progresslight text / 10%, dark text / 14%
progress.normalA program's progress as it runsaccent
progress.errorA program's progress that failedred
progress.pausedA program's progress pausedyellow
tabs.bar.bgThe tab barmix(background, foreground, 6%)
status-bar.bgThe status bar's band across the window's bottom, while a plugin's view fills it · Since 1.4tabs.bar.bg
tabs.track.bgThe track of the tab bar's pillslight text / 7%, dark text / 10%
tabs.active.bgThe tab that showsbackground
tabs.active.fgThe title of the tab that showstext
tabs.active.borderThe border of the tab that showslight text / 10%, dark text / 12%
tabs.active.shadowThe shadow of the tab that showslight #000000 / 12%, dark #000000 / 40%
tabs.inactive.bgThe other tabstransparent
tabs.inactive.fgThe other tabs' titlesreadable(mix(text, background, 40%), on: tabs.bar.bg)
tabs.hover.bgA tab under the pointerlight text / 5%, dark text / 6%
tabs.seamless.lineThe seamless tab bar's linetext / 12%
tabs.seamless.veilThe veil over the seamless tab bar's other tabslight #000000 / 6%, dark #000000 / 27%
segments.bgA segmented controllight text / 6%, dark text / 8%
segments.chosen.bgA segmented control's chosen segmentaccent
segments.chosen.fgThe text of a segmented control's chosen segmentcontrasting(segments.chosen.bg)
segments.box.bgThe box under a segmented control's tabstext / 3%
segments.box.borderThe border of the box under a segmented control's tabstext / 10%
search.matchThe find bar's matcheslight yellow / 50%, dark yellow / 30%
search.match.currentThe find bar's current matchlight mix(yellow, red, 50%) / 60%, dark mix(yellow, red, 50%) / 50%
gutter.runningThe bar beside the prompt of a command that runsaccent
gutter.succeededThe bar beside the prompt of a command that succeededlight text / 22%, dark text / 25%
gutter.failedThe bar beside the prompt of a command that failedred
terminal.bgA bar of the terminal's own backgroundbackground
terminal.fgA bar of the terminal's own textforeground
cursor.guideThe band across the cursor's row, as the cursor guide shows itforeground / 10%
hints.label.bgA hint's label, over the first cells of what it picks · Since 1.3accent
hints.label.fgA hint's label's letters · Since 1.3contrasting(hints.label.bg)
blocks.dividerThe line at the top of each command's block, across the pane, as Blocks shows it · Since 1.4separator
blocks.selected.bgThe tint over the rows of the block that the keyboard selects, across the pane · Since 1.4light accent / 12%, dark accent / 20%
blocks.failedThe tint over the rows of a block whose command failed, as Blocks shows it where asked · Since 1.4light gutter.failed / 8%, dark gutter.failed / 12%
trigger.highlightThe text that a trigger highlights, of no color of its own · Since 1.7light yellow / 45%, dark yellow / 35%
trigger.markA trigger's mark in the gutter beside the line that it matched · Since 1.7yellow

A plugin's tokens

A plugin can take colors of a theme too: a section of the theme of a name of the plugin's gives tokens of that name, which the plugin's config names. The built-in Blocks plugin names the colors of its command's header so:

# In the theme
[blocks]
pill = "#2a2a2d"

# In the config
[plugins.blocks]
background = "blocks.pill"

A theme that lacks the token leaves the header the color of the name's first part, then none; the guide of [plugins.blocks] tells its keys, which the command header shares while Blocks is off.

The [blocks] section holds Lokyr's own tokens of the blocks too, divider, selected and failed, of the table above, beside the plugin's: a name there that Lokyr doesn't know is the plugin's, so no notice tells of it · Since 1.4.

extends

[theme]
name = "Harbor Bright"
extends = "Harbor"

[terminal]
background = "#0b0e13"

A theme that extends another takes all of its colors and gives its own over them: the smallest change of a theme that you like is a file of extends and the colors that you change. A theme extends eight others at most, one after another, and none of its chain twice.

How Lokyr reads .itermcolors

Lokyr reads an .itermcolors file of the themes folder as iTerm2 reads it, and converts it to its own format only when you ask, as the Theme Editor offers before you edit it, the original moved to the Trash: its name is the file's, without .itermcolors. Each color's Color Space tells how its components read: sRGB as they are, P3 of Display P3, and Calibrated, Device or none, as old files have, of calibrated Generic RGB; each converted to sRGB and cut to its gamut, as macOS cuts it. Lokyr takes its Ansi 0 Color to Ansi 15 Color, Background Color, Foreground Color, Cursor Color, Cursor Text Color, Selection Color, Selected Text Color, Bold Color, Link Color, Underline Color and Cursor Guide Color, the token cursor.guide, and colors the interface of them by the tokens' rules. A file of keys of both appearances, ending in (Light) and (Dark), is two themes, <name> (Light) and <name> (Dark), each named so in the config.

Sharing a theme

Share a theme's file as it is: anyone installs it as above.