OKLCH to HEX: #0F172B

Also known as: Tailwind slate-900

Result

oklch(0.20840 0.04166 266.359) → #0F172B

Values are shown at full precision, so converting back gives exactly #0f172b. 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.20840 0.04166 266.359)
  2. 2. OKLCH → Oklab

    a = C·cos H = -0.00265
    b = C·sin H = -0.04158
  3. 3. Oklab → LMS′

    l′ = L + 0.3963·a + 0.2158·b = 0.198379
    m′ = L − 0.1056·a − 0.0639·b = 0.211334
    s′ = L − 0.0895·a − 1.2915·b = 0.262331
  4. 4. cube

    l = 0.198379³ = 0.007807
    m = 0.211334³ = 0.009439
    s = 0.262331³ = 0.018053
  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.024156
  6. 6. linear → sRGB, × 255

    R = 0.05882 × 255 = 15.00 → 15
    G = 0.09019 × 255 = 23.00 → 23
    B = 0.16862 × 255 = 43.00 → 43
  7. 7. RGB → HEX

    #0F172B

All formats

HEX
#0f172b
RGB
rgb(15 23 43)
RGB (legacy)
rgb(15, 23, 43)
HSL
hsl(222.86 48.28% 11.37%) → hsl(223 48% 11%)
HWB
hwb(223 6% 83%)
OKLCH
oklch(0.208 0.042 266.4) · oklch(20.8% 0.042 266.4)
OKLab
oklab(0.208 -0.003 -0.042)
Lab (D50)
lab(7.83 1.92 -14.95)
LCH (D50)
lch(7.83 15.07 277.33)
Display P3
color(display-p3 0.0653 0.0893 0.1629)
Linear sRGB
color(srgb-linear 0.0048 0.0086 0.0242)

Gamut: sRGB and Display P3

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

CSS snippets

.element {
  color: #0f172b;
  color: rgb(15 23 43);
  color: hsl(223 48% 11%);
  color: oklch(0.208 0.042 266.4);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.208 0.042 266.4);
}
/* arbitrary values */
class="text-[#0f172b] bg-[oklch(0.208_0.042_266.4)]"

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

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

  • #1D253B · oklch(0.268 0.042 266.4) · ΔL +0.06
  • #04091C · oklch(0.148 0.042 266.4) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?