OKLCH to HEX: #020618

Also known as: Tailwind slate-950

Result

oklch(0.12985 0.04253 265.132) → #020618

Values are shown at full precision, so converting back gives exactly #020618. 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. input

    oklch(0.12985 0.04253 265.132)
  2. 2. OKLCH → Oklab

    a = C·cos H = -0.00361
    b = C·sin H = -0.04238
  3. 3. Oklab → LMS′

    l′ = L + 0.3963·a + 0.2158·b = 0.119275
    m′ = L − 0.1056·a − 0.0639·b = 0.132937
    s′ = L − 0.0895·a − 1.2915·b = 0.184902
  4. 4. cube

    l = 0.119275³ = 0.001697
    m = 0.132937³ = 0.002349
    s = 0.184902³ = 0.006322
  5. 5. LMS → linear sRGB

    R = 4.0767·l − 3.3077·m + 0.2310·s = 0.000607
    G = −1.2684·l + 2.6098·m − 0.3413·s = 0.001821
    B = −0.0042·l − 0.7034·m + 1.7076·s = 0.009135
  6. 6. linear → sRGB, × 255

    R = 0.00784 × 255 = 2.00 → 2
    G = 0.02353 × 255 = 6.00 → 6
    B = 0.09412 × 255 = 24.00 → 24
  7. 7. RGB → HEX

    #020618

All formats

HEX
#020618
RGB
rgb(2 6 24)
RGB (legacy)
rgb(2, 6, 24)
HSL
hsl(229.09 84.62% 5.10%) → hsl(229 85% 5%)
HWB
hwb(229 1% 91%)
OKLCH
oklch(0.130 0.043 265.1) · oklch(13.0% 0.043 265.1)
OKLab
oklab(0.130 -0.004 -0.042)
Lab (D50)
lab(1.80 1.41 -9.56)
LCH (D50)
lch(1.80 9.66 278.41)
Display P3
color(display-p3 0.0106 0.0230 0.0894)
Linear sRGB
color(srgb-linear 0.0006 0.0018 0.0091)

Gamut: sRGB and Display P3

#020618 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 48% of the sRGB chroma available.

CSS snippets

.element {
  color: #020618;
  color: rgb(2 6 24);
  color: hsl(229 85% 5%);
  color: oklch(0.130 0.043 265.1);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.130 0.043 265.1);
}
/* arbitrary values */
class="text-[#020618] bg-[oklch(0.130_0.043_265.1)]"

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

/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #020618 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

  • #0A1327 · oklch(0.190 0.043 265.1) · ΔL +0.06
  • #00000A · oklch(0.070 0.043 265.1) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?