OKLCH to HEX: #4F46E5

Also known as: Tailwind v3 indigo-600

Result

oklch(0.51057 0.23005 276.966) → #4F46E5

Values are shown at full precision, so converting back gives exactly #4f46e5. 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.51057 0.23005 276.966)
  2. 2. OKLCH → Oklab

    a = C·cos H = 0.02790
    b = C·sin H = -0.22835
  3. 3. Oklab → LMS′

    l′ = L + 0.3963·a + 0.2158·b = 0.472349
    m′ = L − 0.1056·a − 0.0639·b = 0.522206
    s′ = L − 0.0895·a − 1.2915·b = 0.802986
  4. 4. cube

    l = 0.472349³ = 0.105387
    m = 0.522206³ = 0.142405
    s = 0.802986³ = 0.517755
  5. 5. LMS → linear sRGB

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

    R = 0.30981 × 255 = 79.00 → 79
    G = 0.27451 × 255 = 70.00 → 70
    B = 0.89803 × 255 = 229.00 → 229
  7. 7. RGB → HEX

    #4F46E5

All formats

HEX
#4f46e5
RGB
rgb(79 70 229)
RGB (legacy)
rgb(79, 70, 229)
HSL
hsl(243.40 75.36% 58.63%) → hsl(243 75% 59%)
HWB
hwb(243 27% 10%)
OKLCH
oklch(0.511 0.230 277.0) · oklch(51.1% 0.230 277.0)
OKLab
oklab(0.511 0.028 -0.228)
Lab (D50)
lab(39.38 41.55 -80.97)
LCH (D50)
lch(39.38 91.00 297.16)
Display P3
color(display-p3 0.3039 0.2758 0.8646)
Linear sRGB
color(srgb-linear 0.0782 0.0612 0.7835)

Gamut: sRGB and Display P3

#4F46E5 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.278 and Display P3 reaches 0.297; this color uses 83% of the sRGB chroma available.

CSS snippets

.element {
  color: #4f46e5;
  color: rgb(79 70 229);
  color: hsl(243 75% 59%);
  color: oklch(0.511 0.230 277.0);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.511 0.230 277.0);
}
/* arbitrary values */
class="text-[#4f46e5] bg-[oklch(0.511_0.230_277.0)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.3039 0.2758 0.8646); }
}

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

  • #5E5BFA · oklch(0.571 0.230 277.0) · ΔL +0.06
  • #422FD0 · oklch(0.451 0.230 277.0) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?