HEX to OKLCH: #0000CD
Also known as: CSS mediumblue
Result
#0000CD → oklch(0.383 0.266 264.1)
Values are shown at full precision, so converting back gives exactly #0000cd. 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: 0/255 = 0.00000 → 0.000000 (÷ 12.92) G: 0/255 = 0.00000 → 0.000000 (÷ 12.92) B: 205/255 = 0.80392 → 0.610496 (((x + 0.055) / 1.055)^2.4)
2. linear sRGB → LMS
l = 0.4122·R + 0.5363·G + 0.0514·B = 0.031408 m = 0.2119·R + 0.6807·G + 0.1074·B = 0.065565 s = 0.0883·R + 0.2817·G + 0.6300·B = 0.384599
3. cube root
l′ = ∛0.031408 = 0.315509 m′ = ∛0.065565 = 0.403235 s′ = ∛0.384599 = 0.727226
4. LMS′ → Oklab
L = 0.2105·l′ + 0.7936·m′ − 0.0041·s′ = 0.38345 a = 1.9780·l′ − 2.4286·m′ + 0.4506·s′ = -0.02753 b = 0.0259·l′ + 0.7828·m′ − 0.8087·s′ = -0.26428
5. Oklab → OKLCH
C = √(a² + b²) = 0.26571 H = atan2(b, a) = 264.052° L = 0.38345
6. OKLCH
oklch(0.38345 0.26571 264.052) rounded: oklch(0.383 0.266 264.1)
All formats
- HEX
- #0000cd
- RGB
- rgb(0 0 205)
- RGB (legacy)
- rgb(0, 0, 205)
- HSL
- hsl(240.00 100.00% 40.20%) → hsl(240 100% 40%)
- HWB
- hwb(240 0% 20%)
- OKLCH
- oklch(0.383 0.266 264.1) · oklch(38.3% 0.266 264.1)
- OKLab
- oklab(0.383 -0.028 -0.264)
- Lab (D50)
- lab(22.66 57.93 -95.04)
- LCH (D50)
- lch(22.66 111.30 301.36)
- Display P3
- color(display-p3 0.0000 0.0000 0.7710)
- Linear sRGB
- color(srgb-linear 0.0000 0.0000 0.6105)
Gamut: sRGB and Display P3
#0000CD is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.225 and Display P3 reaches 0.266; this color uses 100% of the sRGB chroma available.
CSS snippets
.element {
color: #0000cd;
color: rgb(0 0 205);
color: hsl(240 100% 40%);
color: oklch(0.383 0.266 264.1);
}
/* Tailwind CSS v4 */
@theme {
--color-brand: oklch(0.383 0.266 264.1);
}
/* arbitrary values */
class="text-[#0000cd] bg-[oklch(0.383_0.266_264.1)]"
/* wide-gamut screens */
@media (color-gamut: p3) {
.element { color: color(display-p3 0.0000 0.0000 0.7710); }
}
/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #0000cd calc(l - 0.1) c h); }Nearby colors
Closest colors in the Tailwind and CSS named palettes (OKLab distance).
- blue-800#193CB8
- blue#0000FF
- indigo-800#372AAC
- v3 blue-800#1E40AF
- indigo-700#432DD7
- v3 indigo-800#3730A3
- v3 indigo-700#4338CA
- blue-700#1447E6
Lighter and darker, same hue and chroma
- #002DE2 · oklch(0.443 0.266 264.1) · ΔL +0.06
- #0900B8 · oklch(0.323 0.266 264.1) · ΔL −0.06
Open in the studio
Other converters for this color
Guides: What is OKLCH?