HEX to OKLCH: #7E2A0C
Also known as: Tailwind orange-900
Result
#7E2A0C → oklch(0.407 0.123 38.0)
Values are shown at full precision, so converting back gives exactly #7e2a0c. 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. sRGB → linear
R: 126/255 = 0.49412 → 0.208637 (((x + 0.055) / 1.055)^2.4) G: 42/255 = 0.16471 → 0.023153 (((x + 0.055) / 1.055)^2.4) B: 12/255 = 0.04706 → 0.003677 (((x + 0.055) / 1.055)^2.4)
2. linear sRGB → LMS
l = 0.4122·R + 0.5363·G + 0.0514·B = 0.098612 m = 0.2119·R + 0.6807·G + 0.1074·B = 0.060366 s = 0.0883·R + 0.2817·G + 0.6300·B = 0.027262
3. cube root
l′ = ∛0.098612 = 0.462001 m′ = ∛0.060366 = 0.392282 s′ = ∛0.027262 = 0.300967
4. LMS′ → Oklab
L = 0.2105·l′ + 0.7936·m′ − 0.0041·s′ = 0.40733 a = 1.9780·l′ − 2.4286·m′ + 0.4506·s′ = 0.09676 b = 0.0259·l′ + 0.7828·m′ − 0.8087·s′ = 0.07565
5. Oklab → OKLCH
C = √(a² + b²) = 0.12282 H = atan2(b, a) = 38.020° L = 0.40733
6. OKLCH
oklch(0.40733 0.12282 38.020) rounded: oklch(0.407 0.123 38.0)
All formats
- HEX
- #7e2a0c
- RGB
- rgb(126 42 12)
- RGB (legacy)
- rgb(126, 42, 12)
- HSL
- hsl(15.79 82.61% 27.06%) → hsl(16 83% 27%)
- HWB
- hwb(16 5% 51%)
- OKLCH
- oklch(0.407 0.123 38.0) · oklch(40.7% 0.123 38.0)
- OKLab
- oklab(0.407 0.097 0.076)
- Lab (D50)
- lab(30.22 36.03 37.43)
- LCH (D50)
- lch(30.22 51.96 46.09)
- Display P3
- color(display-p3 0.4562 0.1874 0.0903)
- Linear sRGB
- color(srgb-linear 0.2086 0.0232 0.0037)
Gamut: sRGB and Display P3
#7E2A0C is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.133 and Display P3 reaches 0.150; this color uses 92% of the sRGB chroma available.
CSS snippets
.element {
color: #7e2a0c;
color: rgb(126 42 12);
color: hsl(16 83% 27%);
color: oklch(0.407 0.123 38.0);
}
/* Tailwind CSS v4 */
@theme {
--color-brand: oklch(0.407 0.123 38.0);
}
/* arbitrary values */
class="text-[#7e2a0c] bg-[oklch(0.407_0.123_38.0)]"
/* wide-gamut screens */
@media (color-gamut: p3) {
.element { color: color(display-p3 0.4562 0.1874 0.0903); }
}
/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #7e2a0c calc(l - 0.1) c h); }Nearby colors
Closest colors in the Tailwind and CSS named palettes (OKLab distance).
- v3 orange-900#7C2D12
- amber-900#7B3306
- v3 amber-900#78350F
- v3 red-900#7F1D1D
- red-900#82181A
- darkred#8B0000
- yellow-900#733E0A
- maroon#800000
Lighter and darker, same hue and chroma
- #913C20 · oklch(0.467 0.123 38.0) · ΔL +0.06
- #6B1700 · oklch(0.347 0.123 38.0) · ΔL −0.06
Open in the studio
Other converters for this color
Guides: What is OKLCH?