RGB to HEX: #6A5ACD

Also known as: CSS slateblue

Result

rgb(106 90 205) → #6A5ACD

Values are shown at full precision, so converting back gives exactly #6a5acd. 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 = 106 = 6×16 + 10 → 6A
    G = 90 = 5×16 + 10 → 5A
    B = 205 = 12×16 + 13 → CD
  2. 2. pairs → HEX

    6A 5A CD → #6A5ACD

All formats

HEX
#6a5acd
RGB
rgb(106 90 205)
RGB (legacy)
rgb(106, 90, 205)
HSL
hsl(248.35 53.49% 57.84%) → hsl(248 53% 58%)
HWB
hwb(248 35% 20%)
OKLCH
oklch(0.544 0.171 285.5) · oklch(54.4% 0.171 285.5)
OKLab
oklab(0.544 0.046 -0.165)
Lab (D50)
lab(44.57 29.65 -58.72)
LCH (D50)
lch(44.57 65.78 296.79)
Display P3
color(display-p3 0.4054 0.3552 0.7771)
Linear sRGB
color(srgb-linear 0.1441 0.1022 0.6105)

Gamut: sRGB and Display P3

#6A5ACD is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.266 and Display P3 reaches 0.286; this color uses 64% of the sRGB chroma available.

CSS snippets

.element {
  color: #6a5acd;
  color: rgb(106 90 205);
  color: hsl(248 53% 58%);
  color: oklch(0.544 0.171 285.5);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.544 0.171 285.5);
}
/* arbitrary values */
class="text-[#6a5acd] bg-[oklch(0.544_0.171_285.5)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.4054 0.3552 0.7771); }
}

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

  • #7B6DE1 · oklch(0.604 0.171 285.5) · ΔL +0.06
  • #5A47B9 · oklch(0.484 0.171 285.5) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?