Tailwind CSS v4 default palette
Tailwind violet-900: #4D179A
In Tailwind CSS v4, violet-900 is defined as --color-violet-900: oklch(38% 0.189 293.745), which is #4D179A in hex and rgb(77, 23, 154): a dark, vivid blue-violet. In Tailwind v3, violet-900 was #4C1D95.
In OKLCH, violet-900 has a lightness of 38.0%, chroma 0.189 and hue 293.7°.
The value fits inside sRGB, so the hex #4D179A represents it without loss on any screen.
In v3, violet-900 was #4C1D95. The v4 value is ΔE OK 1.1 away, below the point where most people can tell them apart; v4 is more saturated.
Tailwind violet sits between indigo and purple, a popular choice for AI and creative-tool branding.
Color codes for violet-900
| Tailwind v4 token | --color-violet-900 |
|---|---|
| OKLCH (source value) | oklch(38% 0.189 293.745) |
| HEX | #4D179A |
| RGB | rgb(77, 23, 154) |
| HSL | hsl(265, 74%, 35%) |
| HWB | hwb(265 9% 40%) |
| CMYK (naive, no ICC profile) | cmyk(50%, 85%, 0%, 40%) |
| Decimal | 5,052,314 |
| Tailwind v3 hex | #4C1D95 |
| Utility classes | bg-violet-900, text-violet-900, border-violet-900 |
Tailwind violet scale
Contrast and accessibility
On violet-900, white text has a contrast ratio of 11.02:1 and passes AAA at any text size; black text reaches 1.90: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-900 | 1.90:1 | Fail | Fail | Fail | Fail | 9.7 |
| White text on violet-900 | 11.02:1 | Pass | Pass | Pass | Pass | −98.2 |
| Violet-900 text on white | 11.02:1 | Pass | Pass | Pass | Pass | 94.2 |
| Violet-900 text on black | 1.90:1 | Fail | Fail | Fail | Fail | −8.3 |
Tints and shades
Each step mixes var(--color-violet-900) with white (tints) or black (shades) in gamma-encoded sRGB, the same result as color-mix(in srgb, var(--color-violet-900), white 25%) in CSS.
Tints (mixed with white)
- 5%
#56239f - 15%
#683aa9 - 25%
#7a51b3 - 35%
#8b68bd - 45%
#9d7fc7 - 55%
#af97d2 - 65%
#c1aedc - 75%
#d3c5e6 - 85%
#e4dcf0 - 95%
#f6f3fa
Shades (mixed with black)
- 5%
#491692 - 15%
#411483 - 25%
#3a1174 - 35%
#320f64 - 45%
#2a0d55 - 55%
#230a45 - 65%
#1b0836 - 75%
#130627 - 85%
#0c0317 - 95%
#040108
Color harmonies
Rotating the hue in OKLCH while keeping lightness and chroma, violet-900's complementary color is #434700 (close to darkslategray), its analogous colors are #0631A4 and #6E0079, and its triadic partners are #702A00 and #00523E. For text on top, white gives the higher contrast.
| Harmony | Rotation | Color |
|---|---|---|
| Complementary | +180° | #434700 |
| Analogous | −30°, +30° | #0631a4#6e0079 |
| Triadic | +120°, +240° | #702a00#00523e |
| Split-complementary | +150°, +210° | #5a3c00#005400 |
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-900 is a cool color: its hue is 265° 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.9 |
| rebeccapurple | #663399 | 7.3 |
| darkslateblue | #483d8b | 7.6 |
Nearest Tailwind v4 colors
| Color | HEX | ΔE OK |
|---|---|---|
| purple-900 | #59168b | 3.8 |
| indigo-800 | #372aac | 5.8 |
| indigo-900 | #312c85 | 6.6 |
Code snippets
<div class="bg-violet-900 text-white">...</div>
<p class="text-violet-900 border-violet-900">...</p>.element {
color: var(--color-violet-900);
background-color: oklch(38% 0.189 293.745);
border-color: #4d179a;
outline-color: rgb(77 23 154);
}import SwiftUI
extension Color {
static let violet900 = Color(red: 0.302, green: 0.090, blue: 0.604)
}import androidx.compose.ui.graphics.Color
val Violet900 = Color(0xFF4D179A)import 'package:flutter/material.dart';
const violet900 = Color(0xFF4D179A);<!-- res/values/colors.xml -->
<color name="violet_900">#4D179A</color>Frequently asked questions
- What is the hex code for Tailwind violet-900?
- In Tailwind CSS v4, violet-900 is oklch(38% 0.189 293.745), which converts to #4D179A (rgb(77, 23, 154)) in sRGB. In Tailwind v3 the same name was #4C1D95.
- What is the difference between violet-900 in Tailwind v3 and v4?
- v3 used the hex #4C1D95; v4 redefined the palette in OKLCH as oklch(38% 0.189 293.745). In v3, violet-900 was #4C1D95. The v4 value is ΔE OK 1.1 away, below the point where most people can tell them apart; v4 is more saturated.
- How do I use violet-900 in plain CSS?
- Tailwind v4 defines every palette color as a theme variable, so in CSS you write var(--color-violet-900). By default Tailwind only emits the variables your project uses; @theme static emits all of them.
- Can you use white text on violet-900?
- White text on violet-900 has a contrast ratio of 11.02:1, which passes both AA and AAA under WCAG 2.2. Black text reaches 1.90: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 violet-900?
- The closest is indigo (#4B0082) at ΔE OK 4.9, followed by rebeccapurple and darkslateblue.
Last reviewed by Arielton Oberek.