RGB to HEX: #BA55D3

Also known as: CSS mediumorchid

Result

rgb(186 85 211) → #BA55D3

Values are shown at full precision, so converting back gives exactly #ba55d3. 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 = 186 = 11×16 + 10 → BA
    G = 85 = 5×16 + 5 → 55
    B = 211 = 13×16 + 3 → D3
  2. 2. pairs → HEX

    BA 55 D3 → #BA55D3

All formats

HEX
#ba55d3
RGB
rgb(186 85 211)
RGB (legacy)
rgb(186, 85, 211)
HSL
hsl(288.10 58.88% 58.04%) → hsl(288 59% 58%)
HWB
hwb(288 33% 17%)
OKLCH
oklch(0.626 0.202 319.2) · oklch(62.6% 0.202 319.2)
OKLab
oklab(0.626 0.153 -0.132)
Lab (D50)
lab(53.37 55.02 -47.45)
LCH (D50)
lch(53.37 72.66 319.23)
Display P3
color(display-p3 0.6800 0.3561 0.8025)
Linear sRGB
color(srgb-linear 0.4910 0.0908 0.6514)

Gamut: sRGB and Display P3

#BA55D3 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.301 and Display P3 reaches 0.324; this color uses 67% of the sRGB chroma available.

CSS snippets

.element {
  color: #ba55d3;
  color: rgb(186 85 211);
  color: hsl(288 59% 58%);
  color: oklch(0.626 0.202 319.2);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.626 0.202 319.2);
}
/* arbitrary values */
class="text-[#ba55d3] bg-[oklch(0.626_0.202_319.2)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.6800 0.3561 0.8025); }
}

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

  • #CE68E7 · oklch(0.686 0.202 319.2) · ΔL +0.06
  • #A741BF · oklch(0.566 0.202 319.2) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?