On this page
  1. oklch()
  2. Syntax & Overview
  3. Notes & Best Practices
  4. Example

oklch()

Prev: `var()` | Up: color | Next: `color-mix()`
Rel: color, Color & Value Functions Guide
Ref: MDN Web Docs — oklch()
Tags: #public #web #css #functions #color #tier/core


Syntax & Overview

oklch(58% 0.18 250 / 0.9)

Perceptually uniform Lightness-Chroma-Hue color space with wide P3 gamut support.

Notes & Best Practices

Example

:root {
  --accent-blue: oklch(58% 0.18 250);
  --accent-teal: oklch(58% 0.18 190); /* same visual lightness! */
}
.badge { background: oklch(58% 0.18 250 / 0.15); color: var(--accent-blue); }

Linked from

Related notes