RGB to HEX: #008000
Also known as: CSS green
Result
rgb(0 128 0) → #008000
Values are shown at full precision, so converting back gives exactly #008000. 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 = 128 = 8×16 + 0 → 80 B = 0 = 0×16 + 0 → 00
2. pairs → HEX
00 80 00 → #008000
All formats
- HEX
- #008000
- RGB
- rgb(0 128 0)
- RGB (legacy)
- rgb(0, 128, 0)
- HSL
- hsl(120.00 100.00% 25.10%) → hsl(120 100% 25%)
- HWB
- hwb(120 0% 50%)
- OKLCH
- oklch(0.520 0.177 142.5) · oklch(52.0% 0.177 142.5)
- OKLab
- oklab(0.520 -0.140 0.108)
- Lab (D50)
- lab(46.28 -47.55 48.59)
- LCH (D50)
- lch(46.28 67.98 134.38)
- Display P3
- color(display-p3 0.2160 0.4942 0.1315)
- Linear sRGB
- color(srgb-linear 0.0000 0.2159 0.0000)
Gamut: sRGB and Display P3
#008000 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.177 and Display P3 reaches 0.208; this color uses 100% of the sRGB chroma available.
CSS snippets
.element {
color: #008000;
color: rgb(0 128 0);
color: hsl(120 100% 25%);
color: oklch(0.520 0.177 142.5);
}
/* Tailwind CSS v4 */
@theme {
--color-brand: oklch(0.520 0.177 142.5);
}
/* arbitrary values */
class="text-[#008000] bg-[oklch(0.520_0.177_142.5)]"
/* wide-gamut screens */
@media (color-gamut: p3) {
.element { color: color(display-p3 0.2160 0.4942 0.1315); }
}
/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #008000 calc(l - 0.1) c h); }Nearby colors
Closest colors in the Tailwind and CSS named palettes (OKLab distance).
- green-700#008236
- forestgreen#228B22
- lime-700#497D00
- v3 green-700#15803D
- v3 lime-700#4D7C0F
- seagreen#2E8B57
- emerald-700#007A55
- darkgreen#006400
Lighter and darker, same hue and chroma
- #259321 · oklch(0.580 0.177 142.5) · ΔL +0.06
- #006E00 · oklch(0.460 0.177 142.5) · ΔL −0.06
Open in the studio
Other converters for this color
Guides: What is OKLCH?