Skip to content
Portfolio
Color#400080rgb(64, 0, 128) · magenta

#400080 color

Values, variations, harmonies, an accessible palette and ready-to-paste CSS for #400080.

Color values

The same color written in every notation you are likely to need. Click any row to copy it.

What HEX means

#400080 packs three channels into hexadecimal pairs from 00 to FF: 40 red, 00 green, 80 blue.

What RGB means

Red 64, green 0, blue 128 — each from 0 to 255. It is the same color as the hex above, just in decimal.

What HSL means

Hue 270° (magenta), saturation 100%, lightness 25%. HSL is handy when you want the same hue a little lighter or less saturated.

Why OKLCH

OKLCH is a perceptual space — changing its lightness (32.2%) matches how your eye reads brightness far better than HSL, which is why the palette below is generated in it.

Accessibility & contrast

WCAG requires at least 4.5:1 for normal text and 3:1 for large text at level AA. Use this to decide whether white or black text belongs on this color.

AaThis text is readable
White text13.73:1
AA AAA AA Large
AaThis text is readable
Black text1.53:1
AA AAA AA Large

Closest accessible alternative

Nudged in lightness to reach 4.5:1 while keeping the hue as close as possible.

Aa

For black text

#865ed5

4.58:1

UI preview

How this color behaves in a real interface, not just as a square.

Badge

A paragraph with a themed link inside it.

Information

An alert accented with this color.

Progress

Tints & shades

A tint mixes the color toward white; a shade mixes it toward black. Click any swatch to open it.

Color harmonies

Schemes built by rotating the hue around the color wheel — the starting point for a coherent palette.

Complementary

Opposite on the wheel — maximum contrast.

Analogous

Neighbours on the wheel — calm and cohesive.

Triadic

Three hues 120° apart — vivid but balanced.

Split complementary

Softer than a straight complement.

Tetradic

Four hues — enough for a design system.

Palette generator

A Tailwind-style 50–950 ramp anchored on this color at step 500, generated in OKLCH so the steps feel evenly spaced.

:root {
  --primary-50: #faf1ff;
  --primary-100: #f0e4ff;
  --primary-200: #dfcbff;
  --primary-300: #c9aeff;
  --primary-400: #ab89fa;
  --primary-500: #400080;
  --primary-600: #734bbd;
  --primary-700: #5d37a0;
  --primary-800: #4a2785;
  --primary-900: #3c1e6d;
  --primary-950: #221040;
}

Gradient

A linear blend from this color to its complement, with the CSS ready to paste.

background: linear-gradient(135deg, #400080, #408000);

Nearest named colors

The closest matches from a corpus of about 31,900 named colours, ranked by ΔE (CIEDE2000) — a measure of how different two colours look. ΔE under 1 is nearly indistinguishable; around 10 is clearly different.

CSS code

Every common way to use this color in a stylesheet or a component.

color: #400080;
background-color: #400080;
:root {
  --color-primary: #400080;
}
color: rgb(64 0 128);
color: oklch(32.2% 0.176 295.82);
<div class="bg-[#400080]">…</div>