RGB to HEX: #C71585

Also known as: CSS mediumvioletred

Result

rgb(199 21 133) → #C71585

Values are shown at full precision, so converting back gives exactly #c71585. 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 = 199 = 12×16 + 7 → C7
    G = 21 = 1×16 + 5 → 15
    B = 133 = 8×16 + 5 → 85
  2. 2. pairs → HEX

    C7 15 85 → #C71585

All formats

HEX
#c71585
RGB
rgb(199 21 133)
RGB (legacy)
rgb(199, 21, 133)
HSL
hsl(322.25 80.91% 43.14%) → hsl(322 81% 43%)
HWB
hwb(322 8% 22%)
OKLCH
oklch(0.553 0.222 349.7) · oklch(55.3% 0.222 349.7)
OKLab
oklab(0.553 0.218 -0.040)
Lab (D50)
lab(45.17 69.57 -14.07)
LCH (D50)
lch(45.17 70.97 348.57)
Display P3
color(display-p3 0.7160 0.1763 0.5105)
Linear sRGB
color(srgb-linear 0.5711 0.0075 0.2346)

Gamut: sRGB and Display P3

#C71585 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.231 and Display P3 reaches 0.259; this color uses 96% of the sRGB chroma available.

CSS snippets

.element {
  color: #c71585;
  color: rgb(199 21 133);
  color: hsl(322 81% 43%);
  color: oklch(0.553 0.222 349.7);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.553 0.222 349.7);
}
/* arbitrary values */
class="text-[#c71585] bg-[oklch(0.553_0.222_349.7)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.7160 0.1763 0.5105); }
}

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

  • #DC3397 · oklch(0.613 0.222 349.7) · ΔL +0.06
  • #B20073 · oklch(0.493 0.222 349.7) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?