#40227C#40227C

#40227C is a dark, vivid violet. Relative luminance 0.037; OKLCH L 34.9% C 0.143 H 292.7°. Best body text is #FFFFFF at 12.08:1 contrast (WCAG AA passes).

Color values

HEX#40227C
RGBrgb(64, 34, 124)
HSLhsl(260, 57%, 31%)
HSVhsv(260, 73%, 49%)
CMYKcmyk(48.4%, 72.6%, 0%, 51.4%)
CIE-LABlab(22.62, 36.15, -46.05)
CIE-LCHlch(22.62, 58.54, 308.14°)
OKLaboklab(34.88% 0.0552 -0.1319)
OKLCHoklch(34.88% 0.143 292.7)
XYZxyz(6.3235, 3.6891, 19.4438)
Luminance0.0369 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#40227C #5E7C22
analogous
#22317C #40227C #6D227C
triadic
#40227C #7C4022 #227C40
tetradic
#40227C #7C2231 #5E7C22 #227C6D
square
#40227C #7C2231 #5E7C22 #227C6D
split-complementary
#40227C #7C6D22 #317C22
monochromatic
#0E081C #27154C #40227C #592FAC #764BCE

Accessibility & contrast

On white

12.08
#40227C on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.74
#40227C on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #40227C
12.08:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##40227C#FFFFFF#000000##FFFFFF
##40227C1.0012.081.7412.08
#FFFFFF12.081.0021.001.00
#0000001.7421.001.0021.00
##FFFFFF12.081.0021.001.00

Color blindness preview

Protanopia (red-blind)
#00377F
Deuteranopia (green-blind)
#00347A
Tritanopia (blue-blind)
#2E394C
Achromatopsia (no color)
#363636

Design tokens & code

CSS
--color: #40227c;
/* rgb */ color: rgb(64, 34, 124);
/* oklch */ color: oklch(34.9% 0.143 292.7);
Tailwind
colors: {
  custom: {
    50: '#7b60a3',
    500: '#40227c',
    950: '#000000',
  },
}
SCSS
$custom: #40227c;
$custom-light: #7b60a3;
$custom-dark: #000000;
JSON
{
  "hex": "#40227c",
  "rgb": {
    "r": 64,
    "g": 34,
    "b": 124
  },
  "hsl": {
    "h": 260,
    "s": 56.962,
    "l": 30.98
  },
  "oklch": {
    "l": 0.34882,
    "c": 0.14301,
    "h": 292.7
  },
  "luminance": 0.03689
}

Semantic roles & 50–950 ramp

primary
#40227C
secondary
#8DAF4B
accent
#E048AD
background
#F7F5FA
surface
#EEE9F4
border
#C9C5CE
text
#0A050F
muted
#7C797F

Preview Lab

Preview with #40227C

Body copy rendered with the generated semantic roles for this colour.

Preview Lab → · Contrast checker → · Palette generator →

#40227C Color — HEX, RGB, HSL, OKLCH & Contrast — Tintiva