#402040

Closest named color: Space Cadet (#2B2D42). oklch(30.1% 0.07 327.1), rgb(64, 32, 64).

Aa

White text reads best on this color (14.01:1).

About this color

#402040 is a dark, muted purple. In OKLCH its lightness is 30%, its chroma 0.070 and its hue 327°. Its hue sits between the warm and cool halves of the wheel. The nearest named color is Space Cadet (#2B2D42), ΔE 0.053 away. White text reads best on it, at 14.01:1.

Hue familyPurples
Lightnessdark (30%)
Chromamuted (0.070)
Temperaturein between
Nearest nameSpace Cadet (#2B2D42)
Black text1.49:1
White text14.01:1

Values

HEX#402040
RGBrgb(64, 32, 64)
HSLhsl(300, 33%, 19%)
OKLCHoklch(30.1% 0.07 327.1)

Contrast

WCAG 2 contrast ratios are the conformance target: AA needs 4.5:1 for body text and 3:1 for large text, AAA needs 7:1. APCA Lc values are supplementary guidance from the WCAG 3 drafts.

PairWCAG 2ResultAPCAAPCA guidance
White text on #402040 14.01:1 AAA Lc -103.5 Preferred for body text
Black text on #402040 1.49:1 Fails Lc 0.0 Not readable
#402040 text on white 14.01:1 AAA Lc 100.5 Preferred for body text
#402040 text on black 1.49:1 Fails Lc 0.0 Not readable

Tints and shades

A 50–950 scale built in OKLCH: the hue is held, lightness follows a Tailwind v4-like curve, and every step is kept inside the sRGB gamut. This color sits at step 950.

  1. Step 50

    50

    #FAF3F9

    oklch(97.1% 0.011 330.1)

  2. Step 100

    100

    #F3E5F2

    oklch(93.7% 0.023 327.9)

  3. Step 200

    200

    #EACFE9

    oklch(88.5% 0.046 327.1)

  4. Step 300

    300

    #DEAEDD

    oklch(80.9% 0.084 327)

  5. Step 400

    400

    #CC82CB

    oklch(70.8% 0.132 327.3)

  6. Step 500

    500

    #BD5FBE

    oklch(63.1% 0.169 327)

  7. Step 600

    600

    #A841AA

    oklch(55.5% 0.185 326.9)

  8. Step 700

    700

    #903292

    oklch(49.1% 0.172 327)

  9. Step 800

    800

    #752B76

    oklch(42.7% 0.141 327.2)

  10. Step 900

    900

    #5F285F

    oklch(37.7% 0.11 327.5)

  11. Step 950

    950 (this color)

    #402040

    oklch(30.1% 0.07 327.1)

Export this scale for Tailwind in the Tailwind colors tool

#402040 with color blindness

Simulated with the Machado et al. (2009) model. ΔE is how far the color moves: below about 0.02 you would not notice a change.

VisionSeen asShift (ΔE)
Protanopia (no red cones)#1D29410.067
Deuteranopia (no green cones)#262D3F0.060
Tritanopia (no blue cones)#42232D0.039
Achromatopsia (no color)#2C2C2C0.070

Harmonies

Hue rotations in OKLCH that keep this color's lightness and chroma.

Complementary

The opposite hue (180°).

  • #402040

    #402040

    oklch(30.1% 0.07 327.1)

  • #113718

    #113718

    oklch(30.1% 0.069 147.2)

Open the complementary palette in the generator

Analogous

Neighbouring hues, 30° either side.

  • #402040

    #402040

    oklch(30.1% 0.07 327.1)

  • #32254C

    #32254C

    oklch(30% 0.07 297.4)

  • #491D2E

    #491D2E

    oklch(30.1% 0.07 357.9)

Open the analogous palette in the generator

Split complementary

The two hues beside the complement (150° and 210°).

  • #402040

    #402040

    oklch(30.1% 0.07 327.1)

  • #2C3200

    #2C3200

    oklch(30.1% 0.069 116.8)

  • #00372D

    #00372D

    oklch(30.1% 0.056 176.2)

Open the split complementary palette in the generator

Triadic

Three hues spaced 120° apart.

  • #402040

    #402040

    oklch(30.1% 0.07 327.1)

  • #3B2B00

    #3B2B00

    oklch(29.9% 0.061 86.6)

  • #00353B

    #00353B

    oklch(30.1% 0.052 207)

Open the triadic palette in the generator

Square

Four hues spaced 90° apart.

  • #402040

    #402040

    oklch(30.1% 0.07 327.1)

  • #472302

    #472302

    oklch(30% 0.07 57.4)

  • #113718

    #113718

    oklch(30.1% 0.069 147.2)

  • #00324B

    #00324B

    oklch(30.1% 0.066 237.6)

Open the square palette in the generator

Palettes with this color

Curated palettes that contain a color within ΔE 0.04 (OKLab) of #402040, closest first.

Similar named colors

The eight closest entries in our named color list, with their ΔE distance.

Use #402040 in your product

Turn it into light and dark UI roles checked for contrast, then export to Tailwind v4, shadcn/ui, CSS or design tokens.