RGB to HEX: #581C87

Also known as: Tailwind v3 purple-900

Result

rgb(88 28 135) → #581C87

Values are shown at full precision, so converting back gives exactly #581c87. 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 = 88 = 5×16 + 8 → 58
    G = 28 = 1×16 + 12 → 1C
    B = 135 = 8×16 + 7 → 87
  2. 2. pairs → HEX

    58 1C 87 → #581C87

All formats

HEX
#581c87
RGB
rgb(88 28 135)
RGB (legacy)
rgb(88, 28, 135)
HSL
hsl(273.64 65.64% 31.96%) → hsl(274 66% 32%)
HWB
hwb(274 11% 47%)
OKLCH
oklch(0.381 0.166 305.0) · oklch(38.1% 0.166 305.0)
OKLab
oklab(0.381 0.095 -0.136)
Lab (D50)
lab(25.18 42.12 -48.39)
LCH (D50)
lch(25.18 64.15 311.03)
Display P3
color(display-p3 0.3177 0.1256 0.5097)
Linear sRGB
color(srgb-linear 0.0976 0.0116 0.2423)

Gamut: sRGB and Display P3

#581C87 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.198 and Display P3 reaches 0.208; this color uses 84% of the sRGB chroma available.

CSS snippets

.element {
  color: #581c87;
  color: rgb(88 28 135);
  color: hsl(274 66% 32%);
  color: oklch(0.381 0.166 305.0);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.381 0.166 305.0);
}
/* arbitrary values */
class="text-[#581c87] bg-[oklch(0.381_0.166_305.0)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.3177 0.1256 0.5097); }
}

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

  • #69309A · oklch(0.441 0.166 305.0) · ΔL +0.06
  • #480074 · oklch(0.321 0.166 305.0) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?