#4040C2#4040C2

#4040C2 is a mid, vivid blue. Relative luminance 0.087; OKLCH L 45.9% C 0.197 H 275.4°. Best body text is #FFFFFF at 7.69:1 contrast (WCAG AA passes).

Color values

HEX#4040C2
RGBrgb(64, 64, 194)
HSLhsl(240, 52%, 51%)
HSVhsv(240, 67%, 76%)
CMYKcmyk(67%, 67%, 0%, 23.9%)
CIE-LABlab(35.30, 40.91, -67.86)
CIE-LCHlch(35.30, 79.23, 301.09°)
OKLaboklab(45.93% 0.0185 -0.1959)
OKLCHoklch(45.93% 0.197 275.4)
XYZxyz(13.6821, 8.6506, 51.9772)
Luminance0.0865 (WCAG relative)
Temperaturecool
Familyblue

Closest named colors

Perceptual scales

Shades

Tints

Tones

OKLCH scale

Color harmonies

complementary
#4040C2 #C2C240
analogous
#4081C2 #4040C2 #8140C2
triadic
#4040C2 #C24040 #40C240
tetradic
#4040C2 #C24081 #C2C240 #40C281
square
#4040C2 #C24081 #C2C240 #40C281
split-complementary
#4040C2 #C28140 #81C240
monochromatic
#212167 #303095 #4040C2 #6E6ED1 #9D9DE0

Accessibility & contrast

On white

7.69
#4040C2 on #FFFFFF
AA ✓AA large ✓AAA ✓

On black

2.73
#4040C2 on #000000
AA ✗AA large ✗AAA ✗

Best text color

#FFFFFF on #4040C2
7.69:1 — WCAG AA (normal text) passes

Contrast matrix

fg \ bg##4040C2#FFFFFF#000000##FFFFFF
##4040C21.007.692.737.69
#FFFFFF7.691.0021.001.00
#0000002.7321.001.0021.00
##FFFFFF7.691.0021.001.00

Color blindness preview

Protanopia (red-blind)
#0059C6
Deuteranopia (green-blind)
#004DC0
Tritanopia (blue-blind)
#00627B
Achromatopsia (no color)
#535353

Design tokens & code

CSS
--color: #4040c2;
/* rgb */ color: rgb(64, 64, 194);
/* oklch */ color: oklch(45.9% 0.197 275.4);
Tailwind
colors: {
  custom: {
    50: '#8575d6',
    500: '#4040c2',
    950: '#000000',
  },
}
SCSS
$custom: #4040c2;
$custom-light: #8575d6;
$custom-dark: #000000;
JSON
{
  "hex": "#4040c2",
  "rgb": {
    "r": 64,
    "g": 64,
    "b": 194
  },
  "hsl": {
    "h": 240,
    "s": 51.587,
    "l": 50.588
  },
  "oklch": {
    "l": 0.45926,
    "c": 0.19677,
    "h": 275.4
  },
  "luminance": 0.08652
}

Semantic roles & 50–950 ramp

primary
#4040C2
secondary
#CCCC92
accent
#DB4DDB
background
#F8F7FD
surface
#F0EDFA
border
#CBC8D3
text
#0C0814
muted
#7D7B83

Preview Lab

Preview with #4040C2

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

Preview Lab → · Contrast checker → · Palette generator →

#4040C2 Color — HEX, RGB, HSL, OKLCH & Contrast — Tintiva