RGB to HEX: #000080
Also known as: CSS navy
Result
rgb(0 0 128) → #000080
Values are shown at full precision, so converting back gives exactly #000080. 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. base 10 → base 16
R = 0 = 0×16 + 0 → 00 G = 0 = 0×16 + 0 → 00 B = 128 = 8×16 + 0 → 80
2. pairs → HEX
00 00 80 → #000080
All formats
- HEX
- #000080
- RGB
- rgb(0 0 128)
- RGB (legacy)
- rgb(0, 0, 128)
- HSL
- hsl(240.00 100.00% 25.10%) → hsl(240 100% 25%)
- HWB
- hwb(240 0% 50%)
- OKLCH
- oklch(0.271 0.188 264.1) · oklch(27.1% 0.188 264.1)
- OKLab
- oklab(0.271 -0.019 -0.187)
- Lab (D50)
- lab(11.34 40.96 -67.20)
- LCH (D50)
- lch(11.34 78.70 301.36)
- Display P3
- color(display-p3 0.0000 0.0000 0.4806)
- Linear sRGB
- color(srgb-linear 0.0000 0.0000 0.2159)
Gamut: sRGB and Display P3
#000080 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.188; this color uses 100% of the sRGB chroma available.
CSS snippets
.element {
color: #000080;
color: rgb(0 0 128);
color: hsl(240 100% 25%);
color: oklch(0.271 0.188 264.1);
}
/* Tailwind CSS v4 */
@theme {
--color-brand: oklch(0.271 0.188 264.1);
}
/* arbitrary values */
class="text-[#000080] bg-[oklch(0.271_0.188_264.1)]"
/* wide-gamut screens */
@media (color-gamut: p3) {
.element { color: color(display-p3 0.0000 0.0000 0.4806); }
}
/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #000080 calc(l - 0.1) c h); }Nearby colors
Closest colors in the Tailwind and CSS named palettes (OKLab distance).
- darkblue#00008B
- midnightblue#191970
- violet-950#2F0D68
- v3 violet-950#2E1065
- blue-950#162456
- v3 blue-950#172554
- indigo-950#1E1A4D
- indigo-900#312C85
Lighter and darker, same hue and chroma
- #011F94 · oklch(0.331 0.188 264.1) · ΔL +0.06
- #05006D · oklch(0.211 0.188 264.1) · ΔL −0.06
Open in the studio
Other converters for this color
Guides: What is OKLCH?