#331F4E

A color in the Violet family

#331f4e is a color in the Violet family: RGB(51, 31, 78), HSL(266°, 43%, 21%), CMYK(35%, 60%, 0%, 69%). Closest named color: midnightblue. Contrast is 14.52:1 on white and 1.45:1 on black. See shades, harmonies and color-blindness simulation.

Color Codes

HEX#331f4e
RGBrgb(51 31 78)
RGB (legacy)rgb(51, 31, 78)
RGB %rgb(20% 12% 31%)
HSLhsl(266 43% 21%)
HSV / HSBhsv(266, 60%, 31%)
HWBhwb(266 12% 69%)
CMYKcmyk(35%, 60%, 0%, 69%)
CIELAB (D50)lab(16.41 18.63 -25.8)
LCHlch(16.41 31.82 305.83)
OKLaboklab(0.2905 0.0433 -0.0721)
OKLCHoklch(0.2905 0.0841 300.95)
Decimal3350350

Properties

Color ToneViolet
Closest named colormidnightblue ΔE 8
Closest web-safe color#333366
Hue266°
Saturation (HSL / HSV)43% / 60%
Lightness (HSL)21%
Brightness or Value (HSV)31%
Luminance (Rec.601 / Rec.709)17% / 15%
Relative luminance (WCAG)0.0223
Red / Green / Blue51 / 31 / 78

WCAG 2.2 Contrast Ratio

On White (#ffffff)
14.52:1
AA Normal (4.5:1) · PassAA Large (3:1) · PassAAA Normal (7:1) · Pass
On Black (#000000)
1.45:1
AA Normal (4.5:1) · FailAA Large (3:1) · FailAAA Normal (7:1) · Fail
Aa Bb 123

APCA Contrast Lc (reference) — As text on white / black: Lc 101.1 / 0 · As background with white / black text: Lc -104 / 0

Lightness Scale (OKLCH 50–950)

Eleven steps that change only perceived lightness while keeping hue and chroma — ready to use as design-system color tokens.

Tints (mixed with white)

Shades (mixed with black)

Color Harmonies

Color Vision Deficiency Simulation

Estimated appearance of this color for people with color vision deficiencies (Machado 2009).

Similar Named Colors

Use in CSS

:root {
  --color-brand: #331f4e;
  --color-brand-oklch: oklch(29.05% 0.0841 300.95);
}
.text { color: var(--color-brand); }
.background { background-color: var(--color-brand); }
.border { border: 1px solid rgb(51 31 78 / 50%); }
/* Tailwind CSS */
<div class="bg-[#331f4e] text-[#331f4e] border-[#331f4e]">