Tailwind CSS v3 color

Tailwind violet-400 #A78BFA

Tailwind CSS v3's violet-400 is #A78BFA. It is a light soft violet in the violet family. In OKLCH it sits at lightness 0.709, chroma 0.159 and hue 293.5°. The nearest CSS named color is mediumpurple (#9370DB), ΔE2000 8.7 away.

Relative luminance
0.3358
OKLCH L · C · h
0.709 · 0.159 · 293.5
Best text
Black 7.71:1
Hue family
Violet

#A78BFA color codes

HEX
#A78BFA
RGB
rgb(167, 139, 250)
HSL
hsl(255, 92%, 76%)
OKLCH
oklch(0.709 0.159 293.5)
OKLab
oklab(0.709 0.064 -0.146)
CIELAB (D65)
L* 64.63, a* 34.56, b* -51.87
XYZ (D65)
X 42.42, Y 33.58, Z 94.67
CMYK (naive)
cmyk(33%, 44%, 0%, 2%)

CIELAB and XYZ use the D65 white point; CSS lab() uses D50, so paste the OKLCH or HEX value into stylesheets. CMYK here is a plain formula with no press profile.

Legibility

Contrast: is #A78BFA accessible?

Black text on it reaches 7.71:1, passing AAA. White text fails at 2.72:1.

WCAG 2 gives the same ratio whichever color is the text; APCA does not, so its Lc changes sign and size with polarity.

Open the Contrast System
  • Black text on it

    7.71:1

    • AA passes
    • AA large passes
    • AAA passes
    • APCA Lc +51
  • White text on it

    2.72:1

    • AA fails
    • AA large fails
    • AAA fails
    • APCA Lc −57
  • As text on black

    7.71:1

    • AA passes
    • AA large passes
    • AAA passes
    • APCA Lc −49
  • As text on white

    2.72:1

    • AA fails
    • AA large fails
    • AAA fails
    • APCA Lc +52

Nearest versions that pass 4.5:1

  • For text on white

    #8063CE 4.57:1

    Darkening its OKLCH lightness from 0.71 to 0.58 reaches 4.57:1 on white, keeping the hue.

  • For text on black

    #A78BFA 7.71:1

    It already reaches 7.71:1 on black, so no change is needed.

Checking another pair? Use the Contrast Checker.

Studio

Adjust #A78BFA live

Move lightness, chroma and hue in OKLCH, or drag on the map. The map is every lightness and chroma at the current hue: sRGB inside the solid area, Display P3 out to the dashed line.

The studio needs JavaScript.

Scale

Shades and tints of #A78BFA

Eleven OKLCH lightness steps at this hue, each with its contrast against white and black. #A78BFA sits at step 400.

  1. 50#F5F3FF
    White
    1.09
    Black
    19.14
  2. 100#ECE8FF
    White
    1.19
    Black
    17.55
  3. 200#D9D0FF
    White
    1.45
    Black
    14.41
  4. 300#C1B0FF
    White
    1.92
    Black
    10.92
  5. 400This color#A78BFA
    White
    2.72
    Black
    7.71
  6. 500#8C6FDC
    White
    3.87
    Black
    5.42
  7. 600#7557C0
    White
    5.41
    Black
    3.88
  8. 700#5F40A4
    White
    7.61
    Black
    2.75
  9. 800#462784
    White
    11.14
    Black
    1.88
  10. 900#300E63
    White
    15.34
    Black
    1.36
  11. 950#1C0042
    White
    18.61
    Black
    1.12

Under each step, white and black text on it; a bold figure passes 4.5:1.

Tailwind CSS v3 violet scale

The real Tailwind palette, for comparison with the computed ramp above.

  1. 50#F5F3FF
    White
    1.09
    Black
    19.14
  2. 100#EDE9FE
    White
    1.18
    Black
    17.68
  3. 200#DDD6FE
    White
    1.38
    Black
    15.12
  4. 300#C4B5FD
    White
    1.84
    Black
    11.37
  5. 400This color#A78BFA
    White
    2.72
    Black
    7.71
  6. 500#8B5CF6
    White
    4.23
    Black
    4.95
  7. 600#7C3AED
    White
    5.69
    Black
    3.68
  8. 700#6D28D9
    White
    7.10
    Black
    2.95
  9. 800#5B21B6
    White
    8.98
    Black
    2.33
  10. 900#4C1D95
    White
    10.95
    Black
    1.91
  11. 950#2E1065
    White
    15.23
    Black
    1.37

Gamut

How vivid #A78BFA can get

At its lightness and hue, sRGB reaches OKLCH chroma 0.169; #A78BFA uses 94% of it. Display P3, which many recent phones and laptops show, reaches 0.183 there: 9% more.

0.00.20.40.60.80.20.40.60.8 460480500520540560580600620
  • sRGB
  • Display P3
  • Rec. 2020
  • Dominant wavelength
OKLCH chroma
0.159
sRGB edge
0.169
Display P3 edge
0.183
Rec. 2020 edge
0.186
Dominant wavelength
446 nm
Excitation purity
42%
Chromaticity
x 0.2485, y 0.1968
  • This color#A78BFA
  • Most vivid in sRGB#A889FF
  • Most vivid in Display P3oklch(0.709 0.183 293.5)

On a screen without Display P3 the last tile shows the sRGB edge instead.

Use the wider color where screens show it
.accent {
  color: #a78bfa;
}
@media (color-gamut: p3) {
  .accent { color: color(display-p3 0.6396 0.5305 1); }
}

Mixing

Mixing #A78BFA

Each row is the same mix worked out in a different space, with the halfway color at its end. sRGB, which older CSS gradients use, can sag gray or dark in the middle; OKLab keeps the lightness steps even; OKLCH holds chroma and hue as it goes.

White #FFFFFF

  • sRGB50%#D3C5FD
  • OKLab50%#D1C6FF
  • OKLCH50%#D1C6FF

Black #000000

  • sRGB50%#54467D
  • OKLab50%#3E3261
  • OKLCH50%#3E3261

Its complement #A2AB00

  • sRGB50%#A59B7D
  • OKLab50%#A1A1A1
  • OKLCH50%#F47470
In CSS
/* A gradient and a mix, worked out in OKLCH */
background: linear-gradient(in oklch, #a78bfa, white);
color: color-mix(in oklch, #a78bfa 50%, white);

In use

#A78BFA in an interface

A button, a link, a heading, a focused field, an icon and a chart line in this color, on a light page and a dark one. Each check is a WCAG 2 contrast minimum: 1.4.3 for text, 1.4.11 for the rest.

Light page

  • Button labelText, 4.5:17.71:1 Passes
  • Link and body-size textText, 4.5:12.72:1 Fails
  • Large headingLarge text, 3:12.72:1 Fails
  • Icons, borders and focus ringsNon-text, 3:12.72:1 Fails

For text on this page, the nearest shade that passes is #8063CE 4.57:1

Dark page

  • Button labelText, 4.5:17.71:1 Passes
  • Link and body-size textText, 4.5:16.88:1 Passes
  • Large headingLarge text, 3:16.88:1 Passes
  • Icons, borders and focus ringsNon-text, 3:16.88:1 Passes

Color vision

How #A78BFA looks with color blindness

Achromatopsia changes it most, ΔE2000 26.1; tritanopia changes it least, 13.3.

Simulated with Machado et al. (2009) at full severity, in linear light.

Simulate a whole page What each type sees
  • Protanopia

    No working red (long-wavelength) cones

    #679EFE ΔE2000 16.2

    Distinct

    Reads as light soft blue

  • Deuteranopia

    No working green (medium-wavelength) cones

    #6B9BF7 ΔE2000 15.1

    Distinct

    Reads as light soft blue

  • Tritanopia

    No working blue (short-wavelength) cones

    #94A0B7 ΔE2000 13.3

    Distinct

    Reads as light grayish blue

  • Achromatopsia

    No cone color vision; lightness only

    #9D9D9D ΔE2000 26.1

    Distinct

    Reads as gray

Pairing check

Checked against its complement, #A2AB00. Their lightness contrast is only 1.08:1, so where hue collapses, add a label, icon or pattern.

VisionThe pairΔE2000Verdict
Normal vision#A78BFA · #A2AB0070.4Stays distinct
Protanopia#679EFE · #B9A20058.5Stays distinct
Deuteranopia#6B9BF7 · #B9A51E57.5Stays distinct
Tritanopia#94A0B7 · #AEA09118.4Stays distinct
Achromatopsia#9D9D9D · #A3A3A31.8Easily confused

Harmony

Color harmonies for #A78BFA

Its complement is #A2AB00, a light soft yellow.

Hue rotations in OKLCH, mapped into sRGB by trimming chroma so hue and lightness stay put.

Open the Harmony Studio
  • Base#A78BFA
  • Complement#A2AB00

Complementary

Open in Harmony Studio
  • −30°#6F9EFF
  • Base#A78BFA
  • +30°#D07CD9
  • Base#A78BFA
  • +120°#EC812F
  • +240°#00BC9A
  • Base#A78BFA
  • +150°#CC9700
  • +210°#5CBA5B

Split-complementary

Open in Harmony Studio

Code

Design tokens

Ready-to-paste tokens in six formats. Rename them to fit your system.

CSS custom property

:root {
  --color-violet-400: #a78bfa;
}

Tailwind config

// tailwind.config.js — already built in as violet-400;
// pin the v3 value explicitly like this:
module.exports = {
  theme: {
    extend: {
      colors: {
        violet: { 400: '#a78bfa' },
      },
    },
  },
};

Tailwind v4 theme

/* app.css — Tailwind CSS v4 */
@import "tailwindcss";

@theme {
  /* v4 has its own violet-400; this pins the v3 value. */
  --color-violet-400: oklch(0.709 0.159 293.5);
}

Design token (W3C DTCG)

{
  "color": {
    "violet-400": {
      "$type": "color",
      "$value": {
        "colorSpace": "srgb",
        "components": [0.6549, 0.5451, 0.9804],
        "hex": "#a78bfa"
      },
      "$description": "Tailwind CSS v3 violet-400"
    }
  }
}

SwiftUI color

import SwiftUI

enum Palette {
    static let violet400 = Color(.sRGB, red: 0.655, green: 0.545, blue: 0.980, opacity: 1)
}

Jetpack Compose color

import androidx.compose.ui.graphics.Color

object Palette {
    val Violet400 = Color(0xFFA78BFA)
}

Matches

The nearest match in each system

The closest CSS name, Tailwind shade, RAL Classic paint and Crayola crayon by ΔE2000; under 2 is hard to tell apart side by side. RAL and Crayola values approximate physical colors.

Tools

Open #A78BFA in the tools

Each opens over this page. More colors live in the Color Library, and every color page is listed on the hub.