Tailwind CSS v4 default palette
Tailwind purple-900: #59168B
In Tailwind CSS v4, purple-900 is defined as --color-purple-900: oklch(38.1% 0.176 304.987), which is #59168B in hex and rgb(89, 22, 139): a dark, vivid violet. In Tailwind v3, purple-900 was #581C87.
In OKLCH, purple-900 has a lightness of 38.1%, chroma 0.176 and hue 305.0°.
The value fits inside sRGB, so the hex #59168B represents it without loss on any screen.
In v3, purple-900 was #581C87. The v4 value is ΔE OK 1.0 away, below the point where most people can tell them apart; v4 is 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-900
| Tailwind v4 token | --color-purple-900 |
|---|---|
| OKLCH (source value) | oklch(38.1% 0.176 304.987) |
| HEX | #59168B |
| RGB | rgb(89, 22, 139) |
| HSL | hsl(274, 73%, 32%) |
| HWB | hwb(274 9% 45%) |
| CMYK (naive, no ICC profile) | cmyk(36%, 84%, 0%, 45%) |
| Decimal | 5,838,475 |
| Tailwind v3 hex | #581C87 |
| Utility classes | bg-purple-900, text-purple-900, border-purple-900 |
Tailwind purple scale
Contrast and accessibility
On purple-900, white text has a contrast ratio of 10.98:1 and passes AAA at any text size; black text reaches 1.91: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 purple-900 | 1.91:1 | Fail | Fail | Fail | Fail | 9.7 |
| White text on purple-900 | 10.98:1 | Pass | Pass | Pass | Pass | −98.2 |
| Purple-900 text on white | 10.98:1 | Pass | Pass | Pass | Pass | 94.2 |
| Purple-900 text on black | 1.91:1 | Fail | Fail | Fail | Fail | −8.4 |
Tints and shades
Each step mixes var(--color-purple-900) with white (tints) or black (shades) in gamma-encoded sRGB, the same result as color-mix(in srgb, var(--color-purple-900), white 25%) in CSS.
Tints (mixed with white)
- 5%
#612291 - 15%
#72399c - 25%
#8350a8 - 35%
#9368b4 - 45%
#a47fbf - 55%
#b496cb - 65%
#c5add6 - 75%
#d6c5e2 - 85%
#e6dcee - 95%
#f7f3f9
Shades (mixed with black)
- 5%
#551584 - 15%
#4c1376 - 25%
#431168 - 35%
#3a0e5a - 45%
#310c4c - 55%
#280a3f - 65%
#1f0831 - 75%
#160623 - 85%
#0d0315 - 95%
#040107
Color harmonies
Rotating the hue in OKLCH while keeping lightness and chroma, purple-900's complementary color is #344C00 (close to darkgreen), its analogous colors are #2F2C9D and #750066, and its triadic partners are #673300 and #005149. For text on top, white gives the higher contrast.
| Harmony | Rotation | Color |
|---|---|---|
| Complementary | +180° | #344c00 |
| Analogous | −30°, +30° | #2f2c9d#750066 |
| Triadic | +120°, +240° | #673300#005149 |
| Split-complementary | +150°, +210° | #534100#005423 |
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-900 is a cool color: its hue is 274° 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 |
|---|---|---|
| indigo | #4b0082 | 4.3 |
| rebeccapurple | #663399 | 6.1 |
| darkslateblue | #483d8b | 7.8 |
Nearest Tailwind v4 colors
| Color | HEX | ΔE OK |
|---|---|---|
| violet-900 | #4d179a | 3.8 |
| fuchsia-900 | #721378 | 6.5 |
| purple-800 | #6e11b0 | 7.1 |
Code snippets
<div class="bg-purple-900 text-white">...</div>
<p class="text-purple-900 border-purple-900">...</p>.element {
color: var(--color-purple-900);
background-color: oklch(38.1% 0.176 304.987);
border-color: #59168b;
outline-color: rgb(89 22 139);
}import SwiftUI
extension Color {
static let purple900 = Color(red: 0.349, green: 0.086, blue: 0.545)
}import androidx.compose.ui.graphics.Color
val Purple900 = Color(0xFF59168B)import 'package:flutter/material.dart';
const purple900 = Color(0xFF59168B);<!-- res/values/colors.xml -->
<color name="purple_900">#59168B</color>Frequently asked questions
- What is the hex code for Tailwind purple-900?
- In Tailwind CSS v4, purple-900 is oklch(38.1% 0.176 304.987), which converts to #59168B (rgb(89, 22, 139)) in sRGB. In Tailwind v3 the same name was #581C87.
- What is the difference between purple-900 in Tailwind v3 and v4?
- v3 used the hex #581C87; v4 redefined the palette in OKLCH as oklch(38.1% 0.176 304.987). In v3, purple-900 was #581C87. The v4 value is ΔE OK 1.0 away, below the point where most people can tell them apart; v4 is more saturated.
- How do I use purple-900 in plain CSS?
- Tailwind v4 defines every palette color as a theme variable, so in CSS you write var(--color-purple-900). By default Tailwind only emits the variables your project uses; @theme static emits all of them.
- Can you use white text on purple-900?
- White text on purple-900 has a contrast ratio of 10.98:1, which passes both AA and AAA under WCAG 2.2. Black text reaches 1.91:1 and fails AA even for large text. In APCA terms that is Lc −98.2 for white and Lc 9.7 for black.
- Which CSS named color is closest to purple-900?
- The closest is indigo (#4B0082) at ΔE OK 4.3, followed by rebeccapurple and darkslateblue.
Last reviewed by Arielton Oberek.