HSL to HEX: #2F0D68

Also known as: Tailwind violet-950

Result

hsl(262.42 77.78% 22.94%) → #2F0D68

Values are shown at full precision, so converting back gives exactly #2f0d68. 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 = 262.42°, S = 77.78%, L = 22.94%
  2. 2. C

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

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

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

    (R′, G′, B′) = (0.13334, 0.00000, 0.35685)
    R = round((0.13334 + 0.05097) × 255) = 47
    G = round((0.00000 + 0.05097) × 255) = 13
    B = round((0.35685 + 0.05097) × 255) = 104
  6. 6. RGB → HEX

    #2F0D68

All formats

HEX
#2f0d68
RGB
rgb(47 13 104)
RGB (legacy)
rgb(47, 13, 104)
HSL
hsl(262.42 77.78% 22.94%) → hsl(262 78% 23%)
HWB
hwb(262 5% 59%)
OKLCH
oklch(0.284 0.141 291.3) · oklch(28.4% 0.141 291.3)
OKLab
oklab(0.284 0.051 -0.132)
Lab (D50)
lab(14.17 33.49 -46.83)
LCH (D50)
lch(14.17 57.58 305.57)
Display P3
color(display-p3 0.1684 0.0594 0.3913)
Linear sRGB
color(srgb-linear 0.0284 0.0040 0.1384)

Gamut: sRGB and Display P3

#2F0D68 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.159 and Display P3 reaches 0.164; this color uses 89% of the sRGB chroma available.

CSS snippets

.element {
  color: #2f0d68;
  color: rgb(47 13 104);
  color: hsl(262 78% 23%);
  color: oklch(0.284 0.141 291.3);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.284 0.141 291.3);
}
/* arbitrary values */
class="text-[#2f0d68] bg-[oklch(0.284_0.141_291.3)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.1684 0.0594 0.3913); }
}

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

  • #3D227B · oklch(0.344 0.141 291.3) · ΔL +0.06
  • #220056 · oklch(0.224 0.141 291.3) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?