Skip to content

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.

violet-900#4D179A

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

Color codes for violet-900
Tailwind v4 token--color-violet-900
OKLCH (source value)oklch(38% 0.189 293.745)
HEX#4D179A
RGBrgb(77, 23, 154)
HSLhsl(265, 74%, 35%)
HWBhwb(265 9% 40%)
CMYK (naive, no ICC profile)cmyk(50%, 85%, 0%, 40%)
Decimal5,052,314
Tailwind v3 hex#4C1D95
Utility classesbg-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.

Contrast and accessibility
PairRatioAAAA largeAAAAAA largeAPCA Lc
Black text on violet-9001.90:1FailFailFailFail9.7
White text on violet-90011.02:1PassPassPassPass−98.2
Violet-900 text on white11.02:1PassPassPassPass94.2
Violet-900 text on black1.90:1FailFailFailFail−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)

  1. 5%
    #56239f
  2. 15%
    #683aa9
  3. 25%
    #7a51b3
  4. 35%
    #8b68bd
  5. 45%
    #9d7fc7
  6. 55%
    #af97d2
  7. 65%
    #c1aedc
  8. 75%
    #d3c5e6
  9. 85%
    #e4dcf0
  10. 95%
    #f6f3fa

Shades (mixed with black)

  1. 5%
    #491692
  2. 15%
    #411483
  3. 25%
    #3a1174
  4. 35%
    #320f64
  5. 45%
    #2a0d55
  6. 55%
    #230a45
  7. 65%
    #1b0836
  8. 75%
    #130627
  9. 85%
    #0c0317
  10. 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.

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

Nearest CSS named colors
ColorHEXΔE OK
indigo#4b00824.9
rebeccapurple#6633997.3
darkslateblue#483d8b7.6

Nearest Tailwind v4 colors

Nearest Tailwind v4 colors
ColorHEXΔE OK
purple-900#59168b3.8
indigo-800#372aac5.8
indigo-900#312c856.6

Code snippets

Tailwind CSS
<div class="bg-violet-900 text-white">...</div>
<p class="text-violet-900 border-violet-900">...</p>
CSS
.element {
  color: var(--color-violet-900);
  background-color: oklch(38% 0.189 293.745);
  border-color: #4d179a;
  outline-color: rgb(77 23 154);
}
SwiftUI
import SwiftUI

extension Color {
  static let violet900 = Color(red: 0.302, green: 0.090, blue: 0.604)
}
Jetpack Compose
import androidx.compose.ui.graphics.Color

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

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