Skip to content

Colors

Otty supports four color depths, layered: 24-bit truecolor, 256-color indexed, ANSI 16, and the default (no SGR).

The 16-color palette

The first 16 entries of the palette are the classic ANSI colors plus their "bright" variants:

IndexNameIndexName
0black8bright black
1red9bright red
2green10bright green
3yellow11bright yellow
4blue12bright blue
5magenta13bright magenta
6cyan14bright cyan
7white15bright white

Set via SGR 3037 / 4047 (regular) and 9097 / 100107 (bright). The actual RGB values come from the active Theme.

The 256-color palette

Indices 015: same as above. Indices 16231: a 6×6×6 RGB cube. Indices 232255: 24 shades of grey.

Set with SGR 38;5;<n> (foreground) or 48;5;<n> (background). See SGR.

24-bit truecolor

SGR 38;2;<r>;<g>;<b> (foreground) or 48;2;<r>;<g>;<b> (background). Each channel 0–255.

Otty advertises truecolor via COLORTERM=truecolor in the environment. Programs that gate on this env var (Neovim, modern shells) light up automatically.

Default colors

SGR 39 resets foreground to the theme default; SGR 49 resets background. These are not "black" or "white" — they're whatever the theme defines as default.

Bold-is-bright

A legacy convention: rendering bold text in the brightness palette. Off in Otty by default. Toggle with bold-is-bright = on in Themes.

Color reporting (OSC 4 / 10 / 11)

Programs can query and modify palette entries at runtime:

  • OSC 4 ; <index> ; <spec> — set / query palette entry
  • OSC 10 ; <spec> — set / query default foreground
  • OSC 11 ; <spec> — set / query default background

A query is <spec> = "?"; the terminal replies with the current value.

See also

  • SGR — the command that uses these.
  • Theme Format — how to define your own palette.

Otty