OKLCH to HEX: #4C1D95

Also known as: Tailwind v3 violet-900

Result

oklch(0.37964 0.17830 293.745) → #4C1D95

Values are shown at full precision, so converting back gives exactly #4c1d95. 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.37964 0.17830 293.745)
  2. 2. OKLCH → Oklab

    a = C·cos H = 0.07180
    b = C·sin H = -0.16321
  3. 3. Oklab → LMS′

    l′ = L + 0.3963·a + 0.2158·b = 0.372875
    m′ = L − 0.1056·a − 0.0639·b = 0.382483
    s′ = L − 0.0895·a − 1.2915·b = 0.583994
  4. 4. cube

    l = 0.372875³ = 0.051843
    m = 0.382483³ = 0.055954
    s = 0.583994³ = 0.199171
  5. 5. LMS → linear sRGB

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

    R = 0.29804 × 255 = 76.00 → 76
    G = 0.11373 × 255 = 29.00 → 29
    B = 0.58430 × 255 = 149.00 → 149
  7. 7. RGB → HEX

    #4C1D95

All formats

HEX
#4c1d95
RGB
rgb(76 29 149)
RGB (legacy)
rgb(76, 29, 149)
HSL
hsl(263.50 67.42% 34.90%) → hsl(264 67% 35%)
HWB
hwb(264 11% 42%)
OKLCH
oklch(0.380 0.178 293.7) · oklch(38.0% 0.178 293.7)
OKLab
oklab(0.380 0.072 -0.163)
Lab (D50)
lab(24.67 42.07 -57.98)
LCH (D50)
lch(24.67 71.63 305.97)
Display P3
color(display-p3 0.2754 0.1246 0.5618)
Linear sRGB
color(srgb-linear 0.0723 0.0123 0.3005)

Gamut: sRGB and Display P3

#4C1D95 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.210 and Display P3 reaches 0.217; this color uses 85% of the sRGB chroma available.

CSS snippets

.element {
  color: #4c1d95;
  color: rgb(76 29 149);
  color: hsl(264 67% 35%);
  color: oklch(0.380 0.178 293.7);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.380 0.178 293.7);
}
/* arbitrary values */
class="text-[#4c1d95] bg-[oklch(0.380_0.178_293.7)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.2754 0.1246 0.5618); }
}

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

  • #5B32A9 · oklch(0.440 0.178 293.7) · ΔL +0.06
  • #3D0082 · oklch(0.320 0.178 293.7) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?