Skip to content

Tailwind CSS v4 default palette

Tailwind violet-500: #8E51FF

In Tailwind CSS v4, violet-500 is defined as --color-violet-500: oklch(60.6% 0.25 292.717), which is #8E51FF in hex and rgb(142, 81, 255): a medium, vivid blue-violet. In Tailwind v3, violet-500 was #8B5CF6.

violet-500#8E51FF

In OKLCH, violet-500 has a lightness of 60.6%, chroma 0.250 and hue 292.7°.

This OKLCH value lies outside sRGB. The hex #8E51FF 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.5234 0.3296 0.9909).

In v3, violet-500 was #8B5CF6. The v4 value is ΔE OK 3.1 away; v4 is more saturated.

Tailwind violet sits between indigo and purple, a popular choice for AI and creative-tool branding.

Color codes for violet-500

Color codes for violet-500
Tailwind v4 token--color-violet-500
OKLCH (source value)oklch(60.6% 0.25 292.717)
HEX#8E51FF
RGBrgb(142, 81, 255)
HSLhsl(261, 100%, 66%)
HWBhwb(261 32% 0%)
CMYK (naive, no ICC profile)cmyk(44%, 68%, 0%, 0%)
Decimal9,327,103
Display P3color(display-p3 0.5234 0.3296 0.9909)
Tailwind v3 hex#8B5CF6
Utility classesbg-violet-500, text-violet-500, border-violet-500

Tailwind violet scale

Contrast and accessibility

On violet-500, black text has a contrast ratio of 4.77:1 and passes AA for normal text; white text reaches 4.40: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-5004.77:1PassPassFailPass34.3
White text on violet-5004.40:1FailPassFailFail−75.3
Violet-500 text on white4.40:1FailPassFailFail69.8
Violet-500 text on black4.77:1PassPassFailPass−31.9

Tints and shades

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

Tints (mixed with white)

  1. 5%
    #945aff
  2. 15%
    #9f6bff
  3. 25%
    #aa7dff
  4. 35%
    #b68eff
  5. 45%
    #c19fff
  6. 55%
    #ccb1ff
  7. 65%
    #d7c2ff
  8. 75%
    #e3d4ff
  9. 85%
    #eee5ff
  10. 95%
    #f9f6ff

Shades (mixed with black)

  1. 5%
    #874df2
  2. 15%
    #7945d9
  3. 25%
    #6b3dbf
  4. 35%
    #5c35a6
  5. 45%
    #4e2d8c
  6. 55%
    #402473
  7. 65%
    #321c59
  8. 75%
    #241440
  9. 85%
    #150c26
  10. 95%
    #07040d

Color harmonies

Rotating the hue in OKLCH while keeping lightness and chroma, violet-500's complementary color is #848A00 (close to olive), its analogous colors are #2C73FF and #C333D6, and its triadic partners are #D05A00 and #009C7A. For text on top, black gives the higher contrast.

Color harmonies
HarmonyRotationColor
Complementary+180°#848a00
Analogous−30°, +30°#2c73ff#c333d6
Triadic+120°, +240°#d05a00#009c7a
Split-complementary+150°, +210°#ab7700#00a000

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-500 is a cool color: its hue is 261° 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
mediumslateblue#7b68ee6.3
blueviolet#8a2be28.2
mediumpurple#9370db9.5

Nearest Tailwind v4 colors

Nearest Tailwind v4 colors
ColorHEXΔE OK
purple-500#ad46ff5.6
indigo-500#615fff7.1
violet-600#7f22fe7.2

Code snippets

Tailwind CSS
<div class="bg-violet-500 text-black">...</div>
<p class="text-violet-500 border-violet-500">...</p>
CSS
.element {
  color: var(--color-violet-500);
  background-color: oklch(60.6% 0.25 292.717);
  border-color: #8e51ff;
  outline-color: rgb(142 81 255);
}
SwiftUI
import SwiftUI

extension Color {
  static let violet500 = Color(red: 0.557, green: 0.318, blue: 1.000)
}
Jetpack Compose
import androidx.compose.ui.graphics.Color

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

const violet500 = Color(0xFF8E51FF);
Android XML
<!-- res/values/colors.xml -->
<color name="violet_500">#8E51FF</color>

Frequently asked questions

What is the hex code for Tailwind violet-500?
In Tailwind CSS v4, violet-500 is oklch(60.6% 0.25 292.717), which converts to #8E51FF (rgb(142, 81, 255)) in sRGB after gamut mapping, because the OKLCH value is outside sRGB. In Tailwind v3 the same name was #8B5CF6.
What is the difference between violet-500 in Tailwind v3 and v4?
v3 used the hex #8B5CF6; v4 redefined the palette in OKLCH as oklch(60.6% 0.25 292.717). In v3, violet-500 was #8B5CF6. The v4 value is ΔE OK 3.1 away; v4 is more saturated.
How do I use violet-500 in plain CSS?
Tailwind v4 defines every palette color as a theme variable, so in CSS you write var(--color-violet-500). By default Tailwind only emits the variables your project uses; @theme static emits all of them.
Can you use white text on violet-500?
White text on violet-500 has a contrast ratio of 4.40:1, which passes AA only for large text (24 px, or 18.66 px bold, and up) under WCAG 2.2. Black text reaches 4.77:1 and passes AA for normal text but not AAA. In APCA terms that is Lc −75.3 for white and Lc 34.3 for black.
Which CSS named color is closest to violet-500?
The closest is mediumslateblue (#7B68EE) at ΔE OK 6.3, followed by blueviolet and mediumpurple.

Last reviewed by Arielton Oberek.