docs/wide-gamut-colors.rst
kitty supports modern wide gamut color formats for precise color specification. These formats can be used anywhere a color value is accepted in the configuration (foreground, background, color0-color255, etc.).
OKLCH is a perceptually uniform color space, ideal for creating color themes. The format is::
foreground oklch(0.9 0.05 140)
color1 oklch(0.7 0.25 25)
Parameters:
Benefits:
Example::
foreground oklch(0.9 0.05 140)
color1 oklch(0.65 0.25 29) # Vibrant red-orange
color2 oklch(0.65 0.25 142) # Vibrant green
color3 oklch(0.70 0.19 90) # Warm yellow
CIE LAB is a device-independent color space designed to approximate human vision.
The format is::
background lab(20 5 -10)
color4 lab(50 0 -50)
Parameters:
Example::
background lab(10 0 0) # Very dark neutral gray
foreground lab(90 0 0) # Very light neutral gray
color1 lab(50 60 40) # Red
color4 lab(50 0 -50) # Blue
When you specify colors in OKLCH or CIE LAB formats that are outside the sRGB color gamut, kitty automatically converts them using the CSS Color Module Level 4 gamut mapping algorithm:
This ensures that wide gamut colors gracefully degrade on standard sRGB displays while taking full advantage of wide gamut displays when available. The mapping happens automatically - you don't need to do anything special.
For example, :code:oklch(0.7 0.4 25) might be too saturated for sRGB but will be
automatically adjusted to fit while preserving the perceived hue and lightness.
CSS Color Module Level 4 <https://www.w3.org/TR/css-color-4/>_OKLCH Color Space <https://bottosson.github.io/posts/oklab/>_