#340F4E

A color in the Purple, Crimson, Magenta family

#340f4e is a color in the Purple, Crimson, Magenta family: RGB(52, 15, 78), HSL(275°, 68%, 18%), CMYK(33%, 81%, 0%, 69%). Closest named color: midnightblue. Contrast is 15.86:1 on white and 1.32:1 on black. See shades, harmonies and color-blindness simulation.

Open in Picker Generate Scheme

Color Codes

HEX#340f4e
RGBrgb(52 15 78)
RGB (legacy)rgb(52, 15, 78)
RGB %rgb(20% 6% 31%)
HSLhsl(275 68% 18%)
HSV / HSBhsv(275, 81%, 31%)
HWBhwb(275 6% 69%)
CMYKcmyk(33%, 81%, 0%, 69%)
CIELAB (D50)lab(13.04 28 -31.2)
LCHlch(13.04 41.92 311.91)
OKLaboklab(0.2669 0.0664 -0.0876)
OKLCHoklch(0.2669 0.11 307.15)
Decimal3411790

Properties

Color TonePurple, Crimson, Magenta
Closest named colormidnightblue ΔE 8.4
Closest web-safe color#330066
Hue275°
Saturation (HSL / HSV)68% / 81%
Lightness (HSL)18%
Brightness or Value (HSV)31%
Luminance (Rec.601 / Rec.709)13% / 11%
Relative luminance (WCAG)0.0162
Red / Green / Blue52 / 15 / 78

WCAG 2.2 Contrast Ratio

On White (#ffffff)
15.86:1
AA Normal (4.5:1) · PassAA Large (3:1) · PassAAA Normal (7:1) · Pass
On Black (#000000)
1.32: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 102.3 / 0 · As background with white / black text: Lc -105 / 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: #340f4e;
  --color-brand-oklch: oklch(26.69% 0.11 307.15);
}
.text { color: var(--color-brand); }
.background { background-color: var(--color-brand); }
.border { border: 1px solid rgb(52 15 78 / 50%); }
/* Tailwind CSS */
<div class="bg-[#340f4e] text-[#340f4e] border-[#340f4e]">