HSL to HEX: #3B0764

Also known as: Tailwind v3 purple-950

Result

hsl(273.55 86.92% 20.98%) → #3B0764

Values are shown at full precision, so converting back gives exactly #3b0764. 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

    H = 273.55°, S = 86.92%, L = 20.98%
  2. 2. C

    C = (1 − |2L − 1|) × S = 0.36472
  3. 3. X

    X = C × (1 − |(H / 60°) mod 2 − 1|) = 0.20394   (H / 60° = 4.5592, sector 4)
  4. 4. m

    m = L − C / 2 = 0.02744
  5. 5. (R′, G′, B′) + m

    (R′, G′, B′) = (0.20394, 0.00000, 0.36472)
    R = round((0.20394 + 0.02744) × 255) = 59
    G = round((0.00000 + 0.02744) × 255) = 7
    B = round((0.36472 + 0.02744) × 255) = 100
  6. 6. RGB → HEX

    #3B0764

All formats

HEX
#3b0764
RGB
rgb(59 7 100)
RGB (legacy)
rgb(59, 7, 100)
HSL
hsl(273.55 86.92% 20.98%) → hsl(274 87% 21%)
HWB
hwb(274 3% 61%)
OKLCH
oklch(0.291 0.143 302.7) · oklch(29.1% 0.143 302.7)
OKLab
oklab(0.291 0.077 -0.121)
Lab (D50)
lab(14.94 36.96 -42.85)
LCH (D50)
lch(14.94 56.59 310.78)
Display P3
color(display-p3 0.2101 0.0451 0.3764)
Linear sRGB
color(srgb-linear 0.0437 0.0021 0.1274)

Gamut: sRGB and Display P3

#3B0764 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.153 and Display P3 reaches 0.160; this color uses 94% of the sRGB chroma available.

CSS snippets

.element {
  color: #3b0764;
  color: rgb(59 7 100);
  color: hsl(274 87% 21%);
  color: oklch(0.291 0.143 302.7);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.291 0.143 302.7);
}
/* arbitrary values */
class="text-[#3b0764] bg-[oklch(0.291_0.143_302.7)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.2101 0.0451 0.3764); }
}

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

  • #4B1D76 · oklch(0.351 0.143 302.7) · ΔL +0.06
  • #2C0052 · oklch(0.231 0.143 302.7) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?