HEX to OKLCH: #020617

Also known as: Tailwind v3 slate-950

Result

#020617 → oklch(0.129 0.041 264.7)

Values are shown at full precision, so converting back gives exactly #020617. The rounded form is what you normally paste into CSS.

Step-by-step math

Every number below is computed from the input, nothing is looked up.

  1. 1. sRGB → linear

    R: 2/255 = 0.00784 → 0.000607  (÷ 12.92)
    G: 6/255 = 0.02353 → 0.001821  (÷ 12.92)
    B: 23/255 = 0.09020 → 0.008568  (((x + 0.055) / 1.055)^2.4)
  2. 2. linear sRGB → LMS

    l = 0.4122·R + 0.5363·G + 0.0514·B = 0.001668
    m = 0.2119·R + 0.6807·G + 0.1074·B = 0.002288
    s = 0.0883·R + 0.2817·G + 0.6300·B = 0.005964
  3. 3. cube root

    l′ = ∛0.001668 = 0.118590
    m′ = ∛0.002288 = 0.131780
    s′ = ∛0.005964 = 0.181352
  4. 4. LMS′ → Oklab

    L = 0.2105·l′ + 0.7936·m′ − 0.0041·s′ = 0.12880
    a = 1.9780·l′ − 2.4286·m′ + 0.4506·s′ = -0.00375
    b = 0.0259·l′ + 0.7828·m′ − 0.8087·s′ = -0.04043
  5. 5. Oklab → OKLCH

    C = √(a² + b²) = 0.04060
    H = atan2(b, a) = 264.695°
    L = 0.12880
  6. 6. OKLCH

    oklch(0.12880 0.04060 264.695)
    rounded: oklch(0.129 0.041 264.7)

All formats

HEX
#020617
RGB
rgb(2 6 23)
RGB (legacy)
rgb(2, 6, 23)
HSL
hsl(228.57 84.00% 4.90%) → hsl(229 84% 5%)
HWB
hwb(229 1% 91%)
OKLCH
oklch(0.129 0.041 264.7) · oklch(12.9% 0.041 264.7)
OKLab
oklab(0.129 -0.004 -0.040)
Lab (D50)
lab(1.77 1.22 -8.85)
LCH (D50)
lch(1.77 8.93 277.85)
Display P3
color(display-p3 0.0106 0.0230 0.0857)
Linear sRGB
color(srgb-linear 0.0006 0.0018 0.0086)

Gamut: sRGB and Display P3

#020617 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.089 and Display P3 reaches 0.089; this color uses 46% of the sRGB chroma available.

CSS snippets

.element {
  color: #020617;
  color: rgb(2 6 23);
  color: hsl(229 84% 5%);
  color: oklch(0.129 0.041 264.7);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.129 0.041 264.7);
}
/* arbitrary values */
class="text-[#020617] bg-[oklch(0.129_0.041_264.7)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.0106 0.0230 0.0857); }
}

/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #020617 calc(l - 0.1) c h); }

Nearby colors

Closest colors in the Tailwind and CSS named palettes (OKLab distance).

Lighter and darker, same hue and chroma

  • #0A1326 · oklch(0.189 0.041 264.7) · ΔL +0.06
  • #000009 · oklch(0.069 0.041 264.7) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?