Skip to content

Tailwind CSS v4 default palette

Tailwind purple-400: #C27AFF

In Tailwind CSS v4, purple-400 is defined as --color-purple-400: oklch(71.4% 0.203 305.504), which is #C27AFF in hex and rgb(194, 122, 255): a light, vivid violet. In Tailwind v3, purple-400 was #C084FC.

purple-400#C27AFF

In OKLCH, purple-400 has a lightness of 71.4%, chroma 0.203 and hue 305.5°.

This OKLCH value lies outside sRGB. The hex #C27AFF 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.7199 0.4925 0.9952).

In v3, purple-400 was #C084FC. The v4 value is ΔE OK 2.7 away; v4 is darker and more saturated.

Tailwind purple is a redder, more magenta-leaning violet than violet, with very high chroma in its mid shades.

Color codes for purple-400

Color codes for purple-400
Tailwind v4 token--color-purple-400
OKLCH (source value)oklch(71.4% 0.203 305.504)
HEX#C27AFF
RGBrgb(194, 122, 255)
HSLhsl(272, 100%, 74%)
HWBhwb(272 48% 0%)
CMYK (naive, no ICC profile)cmyk(24%, 52%, 0%, 0%)
Decimal12,745,471
Display P3color(display-p3 0.7199 0.4925 0.9952)
Tailwind v3 hex#C084FC
Utility classesbg-purple-400, text-purple-400, border-purple-400

Tailwind purple scale

Contrast and accessibility

On purple-400, black text has a contrast ratio of 7.52:1 and passes AAA at any text size; white text reaches 2.79: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.

Contrast and accessibility
PairRatioAAAA largeAAAAAA largeAPCA Lc
Black text on purple-4007.52:1PassPassPassPass50.6
White text on purple-4002.79:1FailFailFailFail−58.7
Purple-400 text on white2.79:1FailFailFailFail53.4
Purple-400 text on black7.52:1PassPassPassPass−48.4

Tints and shades

Each step mixes var(--color-purple-400) with white (tints) or black (shades) in gamma-encoded sRGB, the same result as color-mix(in srgb, var(--color-purple-400), white 25%) in CSS.

Tints (mixed with white)

  1. 5%
    #c581ff
  2. 15%
    #cb8eff
  3. 25%
    #d19bff
  4. 35%
    #d7a9ff
  5. 45%
    #ddb6ff
  6. 55%
    #e4c3ff
  7. 65%
    #ead0ff
  8. 75%
    #f0deff
  9. 85%
    #f6ebff
  10. 95%
    #fcf8ff

Shades (mixed with black)

  1. 5%
    #b874f2
  2. 15%
    #a568d9
  3. 25%
    #925cbf
  4. 35%
    #7e4fa6
  5. 45%
    #6b438c
  6. 55%
    #573773
  7. 65%
    #442b59
  8. 75%
    #311f40
  9. 85%
    #1d1226
  10. 95%
    #0a060d

Color harmonies

Rotating the hue in OKLCH while keeping lightness and chroma, purple-400's complementary color is #85B700 (close to yellowgreen), its analogous colors are #8696FF and #EC68D3, and its triadic partners are #EC8600 and #00BFAF. For text on top, black gives the higher contrast.

Color harmonies
HarmonyRotationColor
Complementary+180°#85b700
Analogous−30°, +30°#8696ff#ec68d3
Triadic+120°, +240°#ec8600#00bfaf
Split-complementary+150°, +210°#c3a000#00c668

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 purple-400 is a cool color: its hue is 272° 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

Nearest CSS named colors
ColorHEXΔE OK
orchid#da70d68.1
violet#ee82ee8.9
mediumorchid#ba55d310.1

Nearest Tailwind v4 colors

Nearest Tailwind v4 colors
ColorHEXΔE OK
violet-400#a684ff4.6
fuchsia-400#ed6aff7.7
indigo-400#7c86ff10.5

Code snippets

Tailwind CSS
<div class="bg-purple-400 text-black">...</div>
<p class="text-purple-400 border-purple-400">...</p>
CSS
.element {
  color: var(--color-purple-400);
  background-color: oklch(71.4% 0.203 305.504);
  border-color: #c27aff;
  outline-color: rgb(194 122 255);
}
SwiftUI
import SwiftUI

extension Color {
  static let purple400 = Color(red: 0.761, green: 0.478, blue: 1.000)
}
Jetpack Compose
import androidx.compose.ui.graphics.Color

val Purple400 = Color(0xFFC27AFF)
Flutter
import 'package:flutter/material.dart';

const purple400 = Color(0xFFC27AFF);
Android XML
<!-- res/values/colors.xml -->
<color name="purple_400">#C27AFF</color>

Frequently asked questions

What is the hex code for Tailwind purple-400?
In Tailwind CSS v4, purple-400 is oklch(71.4% 0.203 305.504), which converts to #C27AFF (rgb(194, 122, 255)) in sRGB after gamut mapping, because the OKLCH value is outside sRGB. In Tailwind v3 the same name was #C084FC.
What is the difference between purple-400 in Tailwind v3 and v4?
v3 used the hex #C084FC; v4 redefined the palette in OKLCH as oklch(71.4% 0.203 305.504). In v3, purple-400 was #C084FC. The v4 value is ΔE OK 2.7 away; v4 is darker and more saturated.
How do I use purple-400 in plain CSS?
Tailwind v4 defines every palette color as a theme variable, so in CSS you write var(--color-purple-400). By default Tailwind only emits the variables your project uses; @theme static emits all of them.
Can you use white text on purple-400?
White text on purple-400 has a contrast ratio of 2.79:1, which fails AA even for large text under WCAG 2.2. Black text reaches 7.52:1 and passes both AA and AAA. In APCA terms that is Lc −58.7 for white and Lc 50.6 for black.
Which CSS named color is closest to purple-400?
The closest is orchid (#DA70D6) at ΔE OK 8.1, followed by violet and mediumorchid.

Last reviewed by Arielton Oberek.