HEX to OKLCH: #4F39F6

Also known as: Tailwind indigo-600

Result

#4F39F6 → oklch(0.510 0.262 276.9)

Values are shown at full precision, so converting back gives exactly #4f39f6. 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. sRGB → linear

    R: 79/255 = 0.30980 → 0.078187  (((x + 0.055) / 1.055)^2.4)
    G: 57/255 = 0.22353 → 0.040915  (((x + 0.055) / 1.055)^2.4)
    B: 246/255 = 0.96471 → 0.921582  (((x + 0.055) / 1.055)^2.4)
  2. 2. linear sRGB → LMS

    l = 0.4122·R + 0.5363·G + 0.0514·B = 0.101586
    m = 0.2119·R + 0.6807·G + 0.1074·B = 0.143394
    s = 0.0883·R + 0.2817·G + 0.6300·B = 0.599008
  3. 3. cube root

    l′ = ∛0.101586 = 0.466600
    m′ = ∛0.143394 = 0.523412
    s′ = ∛0.599008 = 0.842967
  4. 4. LMS′ → Oklab

    L = 0.2105·l′ + 0.7936·m′ − 0.0041·s′ = 0.51015
    a = 1.9780·l′ − 2.4286·m′ + 0.4506·s′ = 0.03162
    b = 0.0259·l′ + 0.7828·m′ − 0.8087·s′ = -0.25989
  5. 5. Oklab → OKLCH

    C = √(a² + b²) = 0.26180
    H = atan2(b, a) = 276.936°
    L = 0.51015
  6. 6. OKLCH

    oklch(0.51015 0.26180 276.936)
    rounded: oklch(0.510 0.262 276.9)

All formats

HEX
#4f39f6
RGB
rgb(79 57 246)
RGB (legacy)
rgb(79, 57, 246)
HSL
hsl(246.98 91.30% 59.41%) → hsl(247 91% 59%)
HWB
hwb(247 22% 4%)
OKLCH
oklch(0.510 0.262 276.9) · oklch(51.0% 0.262 276.9)
OKLab
oklab(0.510 0.032 -0.260)
Lab (D50)
lab(38.30 52.59 -92.32)
LCH (D50)
lch(38.30 106.25 299.67)
Display P3
color(display-p3 0.2966 0.2270 0.9277)
Linear sRGB
color(srgb-linear 0.0782 0.0409 0.9216)

Gamut: sRGB and Display P3

#4F39F6 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.298; this color uses 94% of the sRGB chroma available.

CSS snippets

.element {
  color: #4f39f6;
  color: rgb(79 57 246);
  color: hsl(247 91% 59%);
  color: oklch(0.510 0.262 276.9);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.510 0.262 276.9);
}
/* arbitrary values */
class="text-[#4f39f6] bg-[oklch(0.510_0.262_276.9)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.2966 0.2270 0.9277); }
}

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

  • #5D51FF · oklch(0.570 0.262 276.9) · ΔL +0.06
  • #431AE1 · oklch(0.450 0.262 276.9) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?