HSL to HEX: #3C0366

Also known as: Tailwind purple-950

Result

hsl(274.55 94.29% 20.59%) → #3C0366

Values are shown at full precision, so converting back gives exactly #3c0366. 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 = 274.55°, S = 94.29%, L = 20.59%
  2. 2. C

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

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

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

    (R′, G′, B′) = (0.22359, 0.00000, 0.38829)
    R = round((0.22359 + 0.01176) × 255) = 60
    G = round((0.00000 + 0.01176) × 255) = 3
    B = round((0.38829 + 0.01176) × 255) = 102
  6. 6. RGB → HEX

    #3C0366

All formats

HEX
#3c0366
RGB
rgb(60 3 102)
RGB (legacy)
rgb(60, 3, 102)
HSL
hsl(274.55 94.29% 20.59%) → hsl(275 94% 21%)
HWB
hwb(275 1% 60%)
OKLCH
oklch(0.291 0.149 303.0) · oklch(29.1% 0.149 303.0)
OKLab
oklab(0.291 0.081 -0.125)
Lab (D50)
lab(14.82 38.87 -44.36)
LCH (D50)
lch(14.82 58.98 311.22)
Display P3
color(display-p3 0.2131 0.0308 0.3838)
Linear sRGB
color(srgb-linear 0.0452 0.0009 0.1329)

Gamut: sRGB and Display P3

#3C0366 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 97% of the sRGB chroma available.

CSS snippets

.element {
  color: #3c0366;
  color: rgb(60 3 102);
  color: hsl(275 94% 21%);
  color: oklch(0.291 0.149 303.0);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.291 0.149 303.0);
}
/* arbitrary values */
class="text-[#3c0366] bg-[oklch(0.291_0.149_303.0)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.2131 0.0308 0.3838); }
}

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

  • #4C1B78 · oklch(0.351 0.149 303.0) · ΔL +0.06
  • #2D0054 · oklch(0.231 0.149 303.0) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?