HEX to HSL: #312C85
Also known as: Tailwind indigo-900
Result
#312C85 → hsl(243 50% 35%)
Values are shown at full precision, so converting back gives exactly #312c85. 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. RGB ÷ 255
R = 0.1922 G = 0.1725 B = 0.5216
2. max, min, Δ
max = 0.5216 min = 0.1725 Δ = max − min = 0.3490
3. L
L = (max + min) / 2 = 0.3471 = 34.71%
4. S
S = Δ / (1 − |2L − 1|) = 0.5028 = 50.28%
5. H
max is B → H = 60° × ((R − G) / Δ + 4) = 60° × ((0.1922 − 0.1725) / 0.3490 + 4) = 243.37°
6. HSL
hsl(243.37 50.28% 34.71%)
All formats
- HEX
- #312c85
- RGB
- rgb(49 44 133)
- RGB (legacy)
- rgb(49, 44, 133)
- HSL
- hsl(243.37 50.28% 34.71%) → hsl(243 50% 35%)
- HWB
- hwb(243 17% 48%)
- OKLCH
- oklch(0.359 0.144 278.8) · oklch(35.9% 0.144 278.8)
- OKLab
- oklab(0.359 0.022 -0.142)
- Lab (D50)
- lab(23.37 24.66 -50.32)
- LCH (D50)
- lch(23.37 56.04 296.10)
- Display P3
- color(display-p3 0.1888 0.1732 0.5020)
- Linear sRGB
- color(srgb-linear 0.0307 0.0252 0.2346)
Gamut: sRGB and Display P3
#312C85 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.219 and Display P3 reaches 0.222; this color uses 66% of the sRGB chroma available.
CSS snippets
.element {
color: #312c85;
color: rgb(49 44 133);
color: hsl(243 50% 35%);
color: oklch(0.359 0.144 278.8);
}
/* Tailwind CSS v4 */
@theme {
--color-brand: oklch(0.359 0.144 278.8);
}
/* arbitrary values */
class="text-[#312c85] bg-[oklch(0.359_0.144_278.8)]"
/* wide-gamut screens */
@media (color-gamut: p3) {
.element { color: color(display-p3 0.1888 0.1732 0.5020); }
}
/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #312c85 calc(l - 0.1) c h); }Nearby colors
Closest colors in the Tailwind and CSS named palettes (OKLab distance).
- v3 indigo-900#312E81
- v3 blue-900#1E3A8A
- blue-900#1C398E
- v3 indigo-800#3730A3
- v3 violet-900#4C1D95
- darkslateblue#483D8B
- indigo-800#372AAC
- violet-900#4D179A
Lighter and darker, same hue and chroma
- #3F3E98 · oklch(0.419 0.144 278.8) · ΔL +0.06
- #241972 · oklch(0.299 0.144 278.8) · ΔL −0.06
Open in the studio
Other converters for this color
Guides: What is OKLCH?