#5B21B6 color
The swatch above shows #5B21B6 with its hex code written on it in white and in black, so you can see which of the two is legible before reading the measured ratios below.
#5B21B6 is a medium, vivid violet, closest to the CSS named color rebeccapurple (#663399).
It is also a Tailwind CSS default: violet-800. That means you can write bg-violet-800 or text-violet-800 directly, with no arbitrary-value brackets and no entry in your theme config.
Color values
| HEX | #5B21B6 |
| RGB | rgb(91, 33, 182) |
| HSL | hsl(263, 69%, 42%) |
| CMYK | cmyk(50%, 82%, 0%, 29%) |
| Decimal | 5972406 |
| CSS | color: #5B21B6; |
| Android | 0xFF5B21B6 |
| Swift | UIColor(red: 0.357, green: 0.129, blue: 0.714, alpha: 1) |
Accessibility and contrast
| White text on #5B21B6 | 8.98:1 — AA pass · AA large pass · AAA pass |
| Black text on #5B21B6 | 2.34:1 — AA fail · AA large fail · AAA fail |
| Recommended text color | white |
WCAG 2.1 asks for at least 4.5:1 for body text and 3:1 for large text (18 pt, or 14 pt bold).
Tints and shades of #5B21B6
Each swatch keeps the hue and saturation of #5B21B6 and varies only lightness — the quickest way to build a usable scale from a single brand color.
Colors that go with #5B21B6
Harmonies generated by rotating the hue on the color wheel while holding saturation and lightness constant.
Using #5B21B6 in code
/* CSS */
.element { color: #5B21B6; background-color: #5B21B6; }
.element { color: rgb(91 33 182); }
.element { color: hsl(263 69% 42%); }
/* Tailwind */
<div class="bg-violet-800 text-white">
/* SCSS variable */
$brand: #5B21B6;
Frequently asked questions
What color is #5B21B6?
#5B21B6 is a medium, vivid violet. Its hue sits at 263° on the color wheel, with 69% saturation and 42% lightness.
What is #5B21B6 in RGB?
#5B21B6 converts to rgb(91, 33, 182) — 91 red, 33 green and 182 blue.
What is #5B21B6 in CMYK?
Approximately cmyk(50%, 82%, 0%, 29%). Print output depends on the ICC profile of the press and paper, so treat this as a starting point rather than an exact match.
Should text on #5B21B6 be white or black?
White gives the better contrast ratio (8.98:1 versus 2.34:1).
What is the complementary color of #5B21B6?
#7CB521 — the hue directly opposite #5B21B6 on the color wheel.