HEX to OKLCH: #374151
Also known as: Tailwind v3 gray-700
Result
#374151 → oklch(0.373 0.031 259.7)
Values are shown at full precision, so converting back gives exactly #374151. 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: 55/255 = 0.21569 → 0.038204 (((x + 0.055) / 1.055)^2.4) G: 65/255 = 0.25490 → 0.052861 (((x + 0.055) / 1.055)^2.4) B: 81/255 = 0.31765 → 0.082283 (((x + 0.055) / 1.055)^2.4)
2. linear sRGB → LMS
l = 0.4122·R + 0.5363·G + 0.0514·B = 0.048333 m = 0.2119·R + 0.6807·G + 0.1074·B = 0.052915 s = 0.0883·R + 0.2817·G + 0.6300·B = 0.070102
3. cube root
l′ = ∛0.048333 = 0.364262 m′ = ∛0.052915 = 0.375427 s′ = ∛0.070102 = 0.412328
4. LMS′ → Oklab
L = 0.2105·l′ + 0.7936·m′ − 0.0041·s′ = 0.37293 a = 1.9780·l′ − 2.4286·m′ + 0.4506·s′ = -0.00546 b = 0.0259·l′ + 0.7828·m′ − 0.8087·s′ = -0.03013
5. Oklab → OKLCH
C = √(a² + b²) = 0.03062 H = atan2(b, a) = 259.733° L = 0.37293
6. OKLCH
oklch(0.37293 0.03062 259.733) rounded: oklch(0.373 0.031 259.7)
All formats
- HEX
- #374151
- RGB
- rgb(55 65 81)
- RGB (legacy)
- rgb(55, 65, 81)
- HSL
- hsl(216.92 19.12% 26.67%) → hsl(217 19% 27%)
- HWB
- hwb(217 22% 68%)
- OKLCH
- oklch(0.373 0.031 259.7) · oklch(37.3% 0.031 259.7)
- OKLab
- oklab(0.373 -0.005 -0.030)
- Lab (D50)
- lab(27.13 -0.95 -11.13)
- LCH (D50)
- lch(27.13 11.17 265.11)
- Display P3
- color(display-p3 0.2232 0.2537 0.3122)
- Linear sRGB
- color(srgb-linear 0.0382 0.0529 0.0823)
Gamut: sRGB and Display P3
#374151 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.150 and Display P3 reaches 0.189; this color uses 20% of the sRGB chroma available.
CSS snippets
.element {
color: #374151;
color: rgb(55 65 81);
color: hsl(217 19% 27%);
color: oklch(0.373 0.031 259.7);
}
/* Tailwind CSS v4 */
@theme {
--color-brand: oklch(0.373 0.031 259.7);
}
/* arbitrary values */
class="text-[#374151] bg-[oklch(0.373_0.031_259.7)]"
/* wide-gamut screens */
@media (color-gamut: p3) {
.element { color: color(display-p3 0.2232 0.2537 0.3122); }
}
/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #374151 calc(l - 0.1) c h); }Nearby colors
Closest colors in the Tailwind and CSS named palettes (OKLab distance).
- gray-700#364153
- v3 slate-700#334155
- slate-700#314158
- zinc-700#3F3F46
- mist-700#394447
- neutral-700#404040
- mauve-700#463947
- v3 stone-700#44403C
Lighter and darker, same hue and chroma
- #475162 · oklch(0.433 0.031 259.7) · ΔL +0.06
- #283141 · oklch(0.313 0.031 259.7) · ΔL −0.06
Open in the studio
Other converters for this color
Guides: What is OKLCH?