RGB to HEX: #7F1D1D

Also known as: Tailwind v3 red-900

Result

rgb(127 29 29) → #7F1D1D

Values are shown at full precision, so converting back gives exactly #7f1d1d. 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 = 127 = 7×16 + 15 → 7F
    G = 29 = 1×16 + 13 → 1D
    B = 29 = 1×16 + 13 → 1D
  2. 2. pairs → HEX

    7F 1D 1D → #7F1D1D

All formats

HEX
#7f1d1d
RGB
rgb(127 29 29)
RGB (legacy)
rgb(127, 29, 29)
HSL
hsl(0.00 62.82% 30.59%) → hsl(0 63% 31%)
HWB
hwb(0 11% 50%)
OKLCH
oklch(0.396 0.133 25.7) · oklch(39.6% 0.133 25.7)
OKLab
oklab(0.396 0.120 0.058)
Lab (D50)
lab(28.58 41.98 26.83)
LCH (D50)
lch(28.58 49.82 32.58)
Display P3
color(display-p3 0.4574 0.1470 0.1319)
Linear sRGB
color(srgb-linear 0.2122 0.0123 0.0123)

Gamut: sRGB and Display P3

#7F1D1D is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.161 and Display P3 reaches 0.181; this color uses 83% of the sRGB chroma available.

CSS snippets

.element {
  color: #7f1d1d;
  color: rgb(127 29 29);
  color: hsl(0 63% 31%);
  color: oklch(0.396 0.133 25.7);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.396 0.133 25.7);
}
/* arbitrary values */
class="text-[#7f1d1d] bg-[oklch(0.396_0.133_25.7)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.4574 0.1470 0.1319); }
}

/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #7f1d1d 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

  • #93302D · oklch(0.456 0.133 25.7) · ΔL +0.06
  • #6C040C · oklch(0.336 0.133 25.7) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?