OKLCH to HEX: #0F172A

Also known as: Tailwind v3 slate-900

Result

oklch(0.20768 0.03982 265.755) → #0F172A

Values are shown at full precision, so converting back gives exactly #0f172a. 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.20768 0.03982 265.755)
  2. 2. OKLCH → Oklab

    a = C·cos H = -0.00295
    b = C·sin H = -0.03971
  3. 3. Oklab → LMS′

    l′ = L + 0.3963·a + 0.2158·b = 0.197942
    m′ = L − 0.1056·a − 0.0639·b = 0.210527
    s′ = L − 0.0895·a − 1.2915·b = 0.259230
  4. 4. cube

    l = 0.197942³ = 0.007756
    m = 0.210527³ = 0.009331
    s = 0.259230³ = 0.017420
  5. 5. LMS → linear sRGB

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

    R = 0.05883 × 255 = 15.00 → 15
    G = 0.09020 × 255 = 23.00 → 23
    B = 0.16470 × 255 = 42.00 → 42
  7. 7. RGB → HEX

    #0F172A

All formats

HEX
#0f172a
RGB
rgb(15 23 42)
RGB (legacy)
rgb(15, 23, 42)
HSL
hsl(222.22 47.37% 11.18%) → hsl(222 47% 11%)
HWB
hwb(222 6% 84%)
OKLCH
oklch(0.208 0.040 265.8) · oklch(20.8% 0.040 265.8)
OKLab
oklab(0.208 -0.003 -0.040)
Lab (D50)
lab(7.78 1.59 -14.30)
LCH (D50)
lch(7.78 14.38 276.34)
Display P3
color(display-p3 0.0653 0.0893 0.1592)
Linear sRGB
color(srgb-linear 0.0048 0.0086 0.0232)

Gamut: sRGB and Display P3

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

CSS snippets

.element {
  color: #0f172a;
  color: rgb(15 23 42);
  color: hsl(222 47% 11%);
  color: oklch(0.208 0.040 265.8);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.208 0.040 265.8);
}
/* arbitrary values */
class="text-[#0f172a] bg-[oklch(0.208_0.040_265.8)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.0653 0.0893 0.1592); }
}

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

  • #1D2539 · oklch(0.268 0.040 265.8) · ΔL +0.06
  • #04091B · oklch(0.148 0.040 265.8) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?