#40238C#40238C

#40238C is a dark, vivid violet. Relative luminance 0.042; OKLCH L 36.5% C 0.162 H 288.3°. Best body text is #FFFFFF at 11.43:1 contrast (WCAG AA passes).

Color values

HEX#40238C
RGBrgb(64, 35, 140)
HSLhsl(257, 60%, 34%)
HSVhsv(257, 75%, 55%)
CMYKcmyk(54.3%, 75%, 0%, 45.1%)
CIE-LABlab(24.27, 40.36, -53.39)
CIE-LCHlch(24.27, 66.93, 307.09°)
OKLaboklab(36.51% 0.0507 -0.1535)
OKLCHoklch(36.51% 0.162 288.3)
XYZxyz(7.4476, 4.1851, 25.2212)
Luminance0.0419 (WCAG relative)
Temperaturecool
Familyviolet

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#40238C #6F8C23
analogous
#233B8C #40238C #75238C
triadic
#40238C #8C4023 #238C40
tetradic
#40238C #8C233B #6F8C23 #238C75
square
#40238C #8C233B #6F8C23 #238C75
split-complementary
#40238C #8C7523 #3B8C23
monochromatic
#130B2A #2A175B #40238C #562FBD #7855D4

Accessibility & contrast

On white

11.43
#40238C on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

1.84
#40238C on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #40238C
11.43:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##40238C#FFFFFF#000000##FFFFFF
##40238C1.0011.431.8411.43
#FFFFFF11.431.0021.001.00
#0000001.8421.001.0021.00
##FFFFFF11.431.0021.001.00

Color blindness preview

Protanopia (red-blind)
#003C8F
Deuteranopia (green-blind)
#00378A
Tritanopia (blue-blind)
#223F55
Achromatopsia (no color)
#3A3A3A

Design tokens & code

CSS
--color: #40238c;
/* rgb */ color: rgb(64, 35, 140);
/* oklch */ color: oklch(36.5% 0.162 288.3);
Tailwind
colors: {
  custom: {
    50: '#7d61af',
    500: '#40238c',
    950: '#000000',
  },
}
SCSS
$custom: #40238c;
$custom-light: #7d61af;
$custom-dark: #000000;
JSON
{
  "hex": "#40238c",
  "rgb": {
    "r": 64,
    "g": 35,
    "b": 140
  },
  "hsl": {
    "h": 256.571,
    "s": 60,
    "l": 34.314
  },
  "oklch": {
    "l": 0.3651,
    "c": 0.16163,
    "h": 288.3
  },
  "luminance": 0.04186
}

Semantic roles & 50–950 ramp

primary
#40238C
secondary
#9CB852
accent
#E345B7
background
#F8F5FA
surface
#EFEAF5
border
#CAC6CF
text
#0B0510
muted
#7C797F

Preview Lab

Preview with #40238C

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

Preview Lab → · Contrast checker → · Palette generator →

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