RGB to HEX: #5B21B6

Also known as: Tailwind v3 violet-800

Result

rgb(91 33 182) → #5B21B6

Values are shown at full precision, so converting back gives exactly #5b21b6. 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 = 91 = 5×16 + 11 → 5B
    G = 33 = 2×16 + 1 → 21
    B = 182 = 11×16 + 6 → B6
  2. 2. pairs → HEX

    5B 21 B6 → #5B21B6

All formats

HEX
#5b21b6
RGB
rgb(91 33 182)
RGB (legacy)
rgb(91, 33, 182)
HSL
hsl(263.36 69.30% 42.16%) → hsl(263 69% 42%)
HWB
hwb(263 13% 29%)
OKLCH
oklch(0.432 0.211 292.8) · oklch(43.2% 0.211 292.8)
OKLab
oklab(0.432 0.081 -0.194)
Lab (D50)
lab(30.04 50.06 -69.00)
LCH (D50)
lch(30.04 85.24 305.96)
Display P3
color(display-p3 0.3296 0.1436 0.6864)
Linear sRGB
color(srgb-linear 0.1046 0.0152 0.4678)

Gamut: sRGB and Display P3

#5B21B6 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.240 and Display P3 reaches 0.248; this color uses 88% of the sRGB chroma available.

CSS snippets

.element {
  color: #5b21b6;
  color: rgb(91 33 182);
  color: hsl(263 69% 42%);
  color: oklch(0.432 0.211 292.8);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.432 0.211 292.8);
}
/* arbitrary values */
class="text-[#5b21b6] bg-[oklch(0.432_0.211_292.8)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.3296 0.1436 0.6864); }
}

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

  • #6B38CA · oklch(0.492 0.211 292.8) · ΔL +0.06
  • #4C00A2 · oklch(0.372 0.211 292.8) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?