RGB to HEX: #9F1239

Also known as: Tailwind v3 rose-800

Result

rgb(159 18 57) → #9F1239

Values are shown at full precision, so converting back gives exactly #9f1239. 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 = 159 = 9×16 + 15 → 9F
    G = 18 = 1×16 + 2 → 12
    B = 57 = 3×16 + 9 → 39
  2. 2. pairs → HEX

    9F 12 39 → #9F1239

All formats

HEX
#9f1239
RGB
rgb(159 18 57)
RGB (legacy)
rgb(159, 18, 57)
HSL
hsl(343.40 79.66% 34.71%) → hsl(343 80% 35%)
HWB
hwb(343 7% 38%)
OKLCH
oklch(0.455 0.171 13.7) · oklch(45.5% 0.171 13.7)
OKLab
oklab(0.455 0.166 0.041)
Lab (D50)
lab(34.79 55.45 18.07)
LCH (D50)
lch(34.79 58.32 18.05)
Display P3
color(display-p3 0.5714 0.1398 0.2310)
Linear sRGB
color(srgb-linear 0.3467 0.0060 0.0409)

Gamut: sRGB and Display P3

#9F1239 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.182 and Display P3 reaches 0.205; this color uses 94% of the sRGB chroma available.

CSS snippets

.element {
  color: #9f1239;
  color: rgb(159 18 57);
  color: hsl(343 80% 35%);
  color: oklch(0.455 0.171 13.7);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.455 0.171 13.7);
}
/* arbitrary values */
class="text-[#9f1239] bg-[oklch(0.455_0.171_13.7)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.5714 0.1398 0.2310); }
}

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

  • #B42C49 · oklch(0.515 0.171 13.7) · ΔL +0.06
  • #8A0029 · oklch(0.395 0.171 13.7) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?