Tailwind CSS v4 default palette
Tailwind violet-400: #A684FF
In Tailwind CSS v4, violet-400 is defined as --color-violet-400: oklch(70.2% 0.183 293.541), which is #A684FF in hex and rgb(166, 132, 255): a light, vivid blue-violet. In Tailwind v3, violet-400 was #A78BFA.
In OKLCH, violet-400 has a lightness of 70.2%, chroma 0.183 and hue 293.5°.
This OKLCH value lies outside sRGB. The hex #A684FF is the sRGB fallback from the CSS Color 4 gamut mapping algorithm; on Display P3 screens browsers show a more saturated color, close to color(display-p3 0.6312 0.5222 0.99).
In v3, violet-400 was #A78BFA. The v4 value is ΔE OK 2.5 away; v4 is darker and more saturated.
Tailwind violet sits between indigo and purple, a popular choice for AI and creative-tool branding.
Color codes for violet-400
| Tailwind v4 token | --color-violet-400 |
|---|---|
| OKLCH (source value) | oklch(70.2% 0.183 293.541) |
| HEX | #A684FF |
| RGB | rgb(166, 132, 255) |
| HSL | hsl(257, 100%, 76%) |
| HWB | hwb(257 52% 0%) |
| CMYK (naive, no ICC profile) | cmyk(35%, 48%, 0%, 0%) |
| Decimal | 10,913,023 |
| Display P3 | color(display-p3 0.6312 0.5222 0.99) |
| Tailwind v3 hex | #A78BFA |
| Utility classes | bg-violet-400, text-violet-400, border-violet-400 |
Tailwind violet scale
Contrast and accessibility
On violet-400, black text has a contrast ratio of 7.36:1 and passes AAA at any text size; white text reaches 2.85:1.
WCAG 2.2 contrast ratios (success criteria 1.4.3 and 1.4.6: AA needs 4.5:1 for normal text and 3:1 for large text, AAA needs 7:1 and 4.5:1). APCA Lc is the lightness contrast from the APCA-W3 0.0.98G model proposed for WCAG 3; a higher absolute value is more readable, and Lc 75 is its suggested minimum for body text.
| Pair | Ratio | AA | AA large | AAA | AAA large | APCA Lc |
|---|---|---|---|---|---|---|
| Black text on violet-400 | 7.36:1 | Pass | Pass | Pass | Pass | 49.6 |
| White text on violet-400 | 2.85:1 | Fail | Fail | Fail | Fail | −59.7 |
| Violet-400 text on white | 2.85:1 | Fail | Fail | Fail | Fail | 54.4 |
| Violet-400 text on black | 7.36:1 | Pass | Pass | Pass | Pass | −47.4 |
Tints and shades
Each step mixes var(--color-violet-400) with white (tints) or black (shades) in gamma-encoded sRGB, the same result as color-mix(in srgb, var(--color-violet-400), white 25%) in CSS.
Tints (mixed with white)
- 5%
#aa8aff - 15%
#b396ff - 25%
#bca3ff - 35%
#c5afff - 45%
#cebbff - 55%
#d7c8ff - 65%
#e0d4ff - 75%
#e9e0ff - 85%
#f2edff - 95%
#fbf9ff
Shades (mixed with black)
- 5%
#9e7df2 - 15%
#8d70d9 - 25%
#7d63bf - 35%
#6c56a6 - 45%
#5b498c - 55%
#4b3b73 - 65%
#3a2e59 - 75%
#2a2140 - 85%
#191426 - 95%
#08070d
Color harmonies
Rotating the hue in OKLCH while keeping lightness and chroma, violet-400's complementary color is #A0A900 (close to darkkhaki), its analogous colors are #649AFF and #D472DF, and its triadic partners are #F37800 and #00BD97. For text on top, black gives the higher contrast.
| Harmony | Rotation | Color |
|---|---|---|
| Complementary | +180° | #a0a900 |
| Analogous | −30°, +30° | #649aff#d472df |
| Triadic | +120°, +240° | #f37800#00bd97 |
| Split-complementary | +150°, +210° | #cf9300#49bb4b |
Computed in OKLCH: the hue is rotated by 180° (complementary), ±30° (analogous), ±120° (triadic) and 180° ±30° (split-complementary) while lightness and chroma stay fixed. Results that fall outside sRGB are brought back with the CSS Color 4 gamut mapping algorithm. Because this uses OKLCH, the values differ from tools that rotate hue in HSL, but every color keeps the same perceived lightness.
Warm or cool?
Tailwind violet-400 is a cool color: its hue is 257° on the HSL wheel, in the green, blue and violet range that is conventionally called cool.
Nearest named and Tailwind colors
Distance is ΔE OK, the Euclidean distance in OKLab multiplied by 100. Values under about 2 are hard to tell apart side by side.
Nearest CSS named colors
| Color | HEX | ΔE OK |
|---|---|---|
| mediumpurple | #9370db | 8.0 |
| mediumslateblue | #7b68ee | 10.2 |
| cornflowerblue | #6495ed | 10.2 |
Nearest Tailwind v4 colors
| Color | HEX | ΔE OK |
|---|---|---|
| purple-400 | #c27aff | 4.6 |
| indigo-400 | #7c86ff | 6.0 |
| violet-500 | #8e51ff | 11.7 |
Code snippets
<div class="bg-violet-400 text-black">...</div>
<p class="text-violet-400 border-violet-400">...</p>.element {
color: var(--color-violet-400);
background-color: oklch(70.2% 0.183 293.541);
border-color: #a684ff;
outline-color: rgb(166 132 255);
}import SwiftUI
extension Color {
static let violet400 = Color(red: 0.651, green: 0.518, blue: 1.000)
}import androidx.compose.ui.graphics.Color
val Violet400 = Color(0xFFA684FF)import 'package:flutter/material.dart';
const violet400 = Color(0xFFA684FF);<!-- res/values/colors.xml -->
<color name="violet_400">#A684FF</color>Frequently asked questions
- What is the hex code for Tailwind violet-400?
- In Tailwind CSS v4, violet-400 is oklch(70.2% 0.183 293.541), which converts to #A684FF (rgb(166, 132, 255)) in sRGB after gamut mapping, because the OKLCH value is outside sRGB. In Tailwind v3 the same name was #A78BFA.
- What is the difference between violet-400 in Tailwind v3 and v4?
- v3 used the hex #A78BFA; v4 redefined the palette in OKLCH as oklch(70.2% 0.183 293.541). In v3, violet-400 was #A78BFA. The v4 value is ΔE OK 2.5 away; v4 is darker and more saturated.
- How do I use violet-400 in plain CSS?
- Tailwind v4 defines every palette color as a theme variable, so in CSS you write var(--color-violet-400). By default Tailwind only emits the variables your project uses; @theme static emits all of them.
- Can you use white text on violet-400?
- White text on violet-400 has a contrast ratio of 2.85:1, which fails AA even for large text under WCAG 2.2. Black text reaches 7.36:1 and passes both AA and AAA. In APCA terms that is Lc −59.7 for white and Lc 49.6 for black.
- Which CSS named color is closest to violet-400?
- The closest is mediumpurple (#9370DB) at ΔE OK 8.0, followed by mediumslateblue and cornflowerblue.
Last reviewed by Arielton Oberek.