a terminal client for Lurker, written in Rust


on this page

theme.lua

Colours. This is the theme table in the config.

A theme is a bundled scheme with anything you set here laid over the top. The starter theme.lua sets nothing at all, and that is deliberate: an empty table lets every colour follow the scheme, which is what lets the picker change how luir looks. Uncomment only the colours you want to differ.

Picking a scheme

alt+t opens the picker. Type to filter, move up and down, and the whole client is redrawn in whichever scheme is highlighted, so you judge it on your own channels rather than on a swatch. enter keeps it and esc puts back what you had. /theme gruvbox sets one without opening the picker.

Where a colour comes from, highest first:

  1. a colour slot set in theme.lua
  2. the scheme chosen in the picker, saved in state.json
  3. name in theme.lua
  4. luir's own palette

So the picker wins over name, and says so when luir starts and the two disagree. /theme reset forgets the picker's choice and hands it back to theme.lua.

If your theme.lua comes from before the schemes existed, it spells out every colour, and those win over any scheme, so the picker appears to do nothing. The picker's footer says as much and counts them. Comment them out, or keep only the ones you actually chose.

Colour values

Every colour slot accepts any of these:

Written as Means
"#7aa2f7" A 24-bit colour
"#7af" Short form, the same as "#77aaff"
"208" An entry from 0 to 255 in the terminal's palette
"brightblue" A named ANSI colour, taken from your terminal's own theme
"default" The terminal's own foreground or background

"default" can also be written "reset" or "none". For background it is the one worth knowing: it lets the terminal's own background show through, so a transparent terminal stays transparent.

The ANSI names are black, red, green, yellow, blue, magenta (or purple), cyan, gray (or grey), darkgray (or darkgrey), and the bright ones: brightred, brightgreen, brightyellow, brightblue, brightmagenta, brightcyan and brightwhite. light works in place of bright, and hyphens, underscores and spaces are ignored, so bright-red and light_red both work.

Careful with white: "white" is the ANSI light grey, the same as "gray". "brightwhite" is the actual white.

The base scheme

name string, optional

The scheme everything else starts from, from the list below. Leave it out for luir's own palette.

Names are matched without regard to case, and - and _ count as the same, so gruvbox-light, gruvbox_light and Gruvbox_Light are one scheme. Three older names still work: dracula finds chadracula, monokai finds monekai, and solarized finds solarized_dark.

A name that matches nothing falls back to luir's own palette, and luir says which name it did not recognise.

Colour slots

Each of these is optional. Set one and it wins over the scheme, including a scheme chosen in the picker. The defaults shown are luir's own palette; any other scheme fills them from its own colours.

background colour, default "default"

Behind everything. luir's own palette uses the terminal's background; every bundled scheme names one of its own, since that is much of what makes it look like itself.

foreground colour, default "#c5cad4"

Ordinary text.

dim colour, default "#5b6272"

Secondary text: hints, labels, and anything that should step back.

border colour, default "#2f3542"

The rules and boxes between panels.

border_focused colour, default "#3d4759"

The border of the panel that has focus.

accent colour, default "#7aa2f7"

Things that should stand out: the focused panel's title, and the name of the buffer you are in.

selection_bg colour, default "#2c3245"

Behind the highlighted row, in the sidebar, the member list and the pickers.

selection_fg colour, default "#e6eaf2"

Text on the highlighted row.

unread colour, default "#e0af68"

Buffers with unread messages, and the unread and activity counts in the status bar.

highlight colour, default "#f7768e"

Messages and buffers that mention you, and the highlight counts.

highlight_bg colour, default "#33202a"

Behind a message that mentions you.

timestamp colour, default "#4d5566"

Message timestamps.

self_nick colour, default "#7dcfff"

Your own nick.

notice colour, default "#bb9af7"

Notices.

action colour, default "#9ece6a"

/me lines.

event colour, default "#5b6272"

Joins, parts, quits and the other server events.

error colour, default "#f7768e"

Errors, and the status bar while the connection is retrying.

success colour, default "#9ece6a"

Confirmations, and the calm end of the lag and send-rate charts.

topic colour, default "#8f96a6"

The channel topic.

Links in messages.

status_bg colour, default "#1c2030"

Behind the status bar, unless status.lua sets its own.

status_fg colour, default "#8f96a6"

Status bar text, unless status.lua sets its own.

nick_palette list of colours

The colours nicks are drawn in when ui.nick_colors is on. Each nick lands on one of them the same way every time, so a person keeps their colour.

luir's own palette has twelve:

nick_palette = {
  "#7aa2f7", "#9ece6a", "#e0af68", "#bb9af7", "#7dcfff", "#f7768e",
  "#73daca", "#ff9e64", "#b4f9f8", "#c0caf5", "#e6a3d0", "#8bd5a0",
},

A bundled scheme uses eight of its accent colours.

Every scheme

Ninety-eight of them: luir's own, then the whole of NvChad's base46 set, under the names NvChad gives them. Any that are meant for a light terminal say so.

How a scheme fills the slots

Each bundled scheme is a base16 palette of sixteen colours, taken verbatim from NvChad's base_16 tables, and every scheme fills luir's slots from them in the same way. That keeps them consistent with one another, and makes porting any other base16 scheme a matter of sixteen colours.

In base16, base00 to base07 run from background to foreground, and base08 to base0F are the accents: red, orange, yellow, green, cyan, blue, magenta and brown.

Slot From
background base00
border, status_bg base01
selection_bg, highlight_bg base02
dim, border_focused, timestamp, event base03
topic, status_fg base04
foreground base05
selection_fg base06
highlight, error base08
unread base0A
action, success base0B
self_nick, link base0C
accent base0D
notice base0E
nick_palette base0D, base0B, base0A, base0E, base0C, base08, base09, base0F

This is a mapping of palettes rather than a match for how a scheme looks in an editor. luir has a sidebar and a member list where an editor has syntax, so the colours are spent on different things.

Examples

Start from a scheme and change only what you disagree with:

return {
  name   = "gruvbox",
  accent = "#7aa2f7",
}

Name a colour once and use it in several places:

local mine = { accent = "#7aa2f7", red = "#f7768e" }

return {
  name      = "gruvbox",
  accent    = mine.accent,
  highlight = mine.red,
  error     = mine.red,
}

Keep a transparent terminal transparent:

return {
  name       = "catppuccin",
  background = "default",
}

A classic terminal palette to go with style = "classic" in ui.lua. It names no scheme and uses only ANSI colours, so it follows whatever your terminal is themed with, the way the old clients did:

return {
  background = "default",    foreground = "gray",
  dim = "darkgray",          border = "darkgray",
  border_focused = "gray",   accent = "brightcyan",
  selection_bg = "blue",     selection_fg = "brightwhite",
  unread = "brightyellow",   highlight = "brightred",
  highlight_bg = "default",  timestamp = "darkgray",
  self_nick = "brightwhite", notice = "brightmagenta",
  action = "brightgreen",    event = "darkgray",
  error = "brightred",       success = "brightgreen",
  topic = "brightcyan",      link = "brightblue",
  status_bg = "blue",        status_fg = "brightwhite",
}