RGB to HEX: #D8B4FE

Also known as: Tailwind v3 purple-300

Result

rgb(216 180 254) → #D8B4FE

Values are shown at full precision, so converting back gives exactly #d8b4fe. 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 = 216 = 13×16 + 8 → D8
    G = 180 = 11×16 + 4 → B4
    B = 254 = 15×16 + 14 → FE
  2. 2. pairs → HEX

    D8 B4 FE → #D8B4FE

All formats

HEX
#d8b4fe
RGB
rgb(216 180 254)
RGB (legacy)
rgb(216, 180, 254)
HSL
hsl(269.19 97.37% 85.10%) → hsl(269 97% 85%)
HWB
hwb(269 71% 0%)
OKLCH
oklch(0.827 0.108 306.4) · oklch(82.7% 0.108 306.4)
OKLab
oklab(0.827 0.064 -0.087)
Lab (D50)
lab(78.47 23.68 -31.86)
LCH (D50)
lch(78.47 39.70 306.62)
Display P3
color(display-p3 0.8243 0.7112 0.9764)
Linear sRGB
color(srgb-linear 0.6867 0.4564 0.9911)

Gamut: sRGB and Display P3

#D8B4FE is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.110 and Display P3 reaches 0.121; this color uses 98% of the sRGB chroma available.

CSS snippets

.element {
  color: #d8b4fe;
  color: rgb(216 180 254);
  color: hsl(269 97% 85%);
  color: oklch(0.827 0.108 306.4);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.827 0.108 306.4);
}
/* arbitrary values */
class="text-[#d8b4fe] bg-[oklch(0.827_0.108_306.4)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.8243 0.7112 0.9764); }
}

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

  • #ECC7FF · oklch(0.887 0.108 306.4) · ΔL +0.06
  • #C5A1EA · oklch(0.767 0.108 306.4) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?