Skip to content

Color Variables

Every theme must define these 19 standard color variables. Values are hex colors without the # prefix.

Standard variables

VariableDescription
backgroundPrimary background color
foregroundPrimary text/foreground color
cursorCursor color
selection-backgroundBackground of selected text
selection-foregroundForeground of selected text

ANSI colors

Each ANSI color has a normal and highlight (-hg) variant:

NormalHighlightANSI code
blackblack-hg0 / 8
redred-hg1 / 9
greengreen-hg2 / 10
yellowyellow-hg3 / 11
blueblue-hg4 / 12
magentamagenta-hg5 / 13
cyancyan-hg6 / 14
whitewhite-hg7 / 15

Format rules

  • Colors are hex values without #: ff5555, not #ff5555
  • Add the appropriate prefix in your patterns:
    • #<[red]>#ff5555 (CSS, kitty, etc.)
    • 0x<[red]>0xff5555 (Alacritty legacy)
    • rgba(<[red]>ff)rgba(ff5555ff) (Hyprland)
  • All 19 variables are required in every theme

Example

[colors]
background = '1e1f28'
foreground = 'f8f8f2'
cursor = 'bbbbbb'
selection-background = '44475a'
selection-foreground = '1e1f28'
black = '000000'
black-hg = '545454'
red = 'ff5555'
red-hg = 'ff5454'
green = '50fa7b'
green-hg = '50fa7b'
yellow = 'f0fa8b'
yellow-hg = 'f0fa8b'
blue = 'bd92f8'
blue-hg = 'bd92f8'
magenta = 'ff78c5'
magenta-hg = 'ff78c5'
cyan = '8ae9fc'
cyan-hg = '8ae9fc'
white = 'bbbbbb'
white-hg = 'ffffff'

Previewing colors

To see a theme’s colors rendered in your terminal:

Terminal window
gtheme theme colors <theme>

This displays each color with its hex value, making it easy to verify your theme looks correct.