RGB to HEX: #15803D

Also known as: Tailwind v3 green-700

Result

rgb(21 128 61) → #15803D

Values are shown at full precision, so converting back gives exactly #15803d. 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. 1. base 10 → base 16

    R = 21 = 1×16 + 5 → 15
    G = 128 = 8×16 + 0 → 80
    B = 61 = 3×16 + 13 → 3D
  2. 2. pairs → HEX

    15 80 3D → #15803D

All formats

HEX
#15803d
RGB
rgb(21 128 61)
RGB (legacy)
rgb(21, 128, 61)
HSL
hsl(142.43 71.81% 29.22%) → hsl(142 72% 29%)
HWB
hwb(142 8% 50%)
OKLCH
oklch(0.527 0.137 150.1) · oklch(52.7% 0.137 150.1)
OKLab
oklab(0.527 -0.119 0.068)
Lab (D50)
lab(46.88 -41.65 27.62)
LCH (D50)
lch(46.88 49.97 146.45)
Display P3
color(display-p3 0.2334 0.4945 0.2677)
Linear sRGB
color(srgb-linear 0.0075 0.2159 0.0467)

Gamut: sRGB and Display P3

#15803D is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.145 and Display P3 reaches 0.202; this color uses 95% of the sRGB chroma available.

CSS snippets

.element {
  color: #15803d;
  color: rgb(21 128 61);
  color: hsl(142 72% 29%);
  color: oklch(0.527 0.137 150.1);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.527 0.137 150.1);
}
/* arbitrary values */
class="text-[#15803d] bg-[oklch(0.527_0.137_150.1)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.2334 0.4945 0.2677); }
}

/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #15803d calc(l - 0.1) c h); }

Nearby colors

Closest colors in the Tailwind and CSS named palettes (OKLab distance).

Lighter and darker, same hue and chroma

  • #2F924E · oklch(0.587 0.137 150.1) · ΔL +0.06
  • #006E2C · oklch(0.467 0.137 150.1) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?