Skip to content

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.

purple-900#59168B

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

Color codes for purple-900
Tailwind v4 token--color-purple-900
OKLCH (source value)oklch(38.1% 0.176 304.987)
HEX#59168B
RGBrgb(89, 22, 139)
HSLhsl(274, 73%, 32%)
HWBhwb(274 9% 45%)
CMYK (naive, no ICC profile)cmyk(36%, 84%, 0%, 45%)
Decimal5,838,475
Tailwind v3 hex#581C87
Utility classesbg-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.

Contrast and accessibility
PairRatioAAAA largeAAAAAA largeAPCA Lc
Black text on purple-9001.91:1FailFailFailFail9.7
White text on purple-90010.98:1PassPassPassPass−98.2
Purple-900 text on white10.98:1PassPassPassPass94.2
Purple-900 text on black1.91:1FailFailFailFail−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)

  1. 5%
    #612291
  2. 15%
    #72399c
  3. 25%
    #8350a8
  4. 35%
    #9368b4
  5. 45%
    #a47fbf
  6. 55%
    #b496cb
  7. 65%
    #c5add6
  8. 75%
    #d6c5e2
  9. 85%
    #e6dcee
  10. 95%
    #f7f3f9

Shades (mixed with black)

  1. 5%
    #551584
  2. 15%
    #4c1376
  3. 25%
    #431168
  4. 35%
    #3a0e5a
  5. 45%
    #310c4c
  6. 55%
    #280a3f
  7. 65%
    #1f0831
  8. 75%
    #160623
  9. 85%
    #0d0315
  10. 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.

Color harmonies
HarmonyRotationColor
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

Nearest CSS named colors
ColorHEXΔE OK
indigo#4b00824.3
rebeccapurple#6633996.1
darkslateblue#483d8b7.8

Nearest Tailwind v4 colors

Nearest Tailwind v4 colors
ColorHEXΔE OK
violet-900#4d179a3.8
fuchsia-900#7213786.5
purple-800#6e11b07.1

Code snippets

Tailwind CSS
<div class="bg-purple-900 text-white">...</div>
<p class="text-purple-900 border-purple-900">...</p>
CSS
.element {
  color: var(--color-purple-900);
  background-color: oklch(38.1% 0.176 304.987);
  border-color: #59168b;
  outline-color: rgb(89 22 139);
}
SwiftUI
import SwiftUI

extension Color {
  static let purple900 = Color(red: 0.349, green: 0.086, blue: 0.545)
}
Jetpack Compose
import androidx.compose.ui.graphics.Color

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

const purple900 = Color(0xFF59168B);
Android XML
<!-- 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.