Skip to content

Tailwind CSS v4 default palette

Tailwind violet-300: #C4B4FF

In Tailwind CSS v4, violet-300 is defined as --color-violet-300: oklch(81.1% 0.111 293.571), which is #C4B4FF in hex and rgb(196, 180, 255): a very light, moderately saturated blue-violet. In Tailwind v3, violet-300 was #C4B5FD.

violet-300#C4B4FF

In OKLCH, violet-300 has a lightness of 81.1%, chroma 0.111 and hue 293.6°.

This OKLCH value lies outside sRGB. The hex #C4B4FF 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.7589 0.7063 0.9917).

In v3, violet-300 was #C4B5FD. The v4 value is ΔE OK 1.0 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-300

Color codes for violet-300
Tailwind v4 token--color-violet-300
OKLCH (source value)oklch(81.1% 0.111 293.571)
HEX#C4B4FF
RGBrgb(196, 180, 255)
HSLhsl(253, 100%, 85%)
HWBhwb(253 71% 0%)
CMYK (naive, no ICC profile)cmyk(23%, 29%, 0%, 0%)
Decimal12,891,391
Display P3color(display-p3 0.7589 0.7063 0.9917)
Tailwind v3 hex#C4B5FD
Utility classesbg-violet-300, text-violet-300, border-violet-300

Tailwind violet scale

Contrast and accessibility

On violet-300, black text has a contrast ratio of 11.31:1 and passes AAA at any text size; white text reaches 1.85: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-30011.31:1PassPassPassPass69.0
White text on violet-3001.85:1FailFailFailFail−39.1
Violet-300 text on white1.85:1FailFailFailFail34.9
Violet-300 text on black11.31:1PassPassPassPass−67.6

Tints and shades

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

Tints (mixed with white)

  1. 5%
    #c7b8ff
  2. 15%
    #cdbfff
  3. 25%
    #d3c7ff
  4. 35%
    #d9ceff
  5. 45%
    #dfd6ff
  6. 55%
    #e4ddff
  7. 65%
    #eae5ff
  8. 75%
    #f0ecff
  9. 85%
    #f6f4ff
  10. 95%
    #fcfbff

Shades (mixed with black)

  1. 5%
    #baabf2
  2. 15%
    #a799d9
  3. 25%
    #9387bf
  4. 35%
    #7f75a6
  5. 45%
    #6c638c
  6. 55%
    #585173
  7. 65%
    #453f59
  8. 75%
    #312d40
  9. 85%
    #1d1b26
  10. 95%
    #0a090d

Color harmonies

Rotating the hue in OKLCH while keeping lightness and chroma, violet-300's complementary color is #C1C973 (close to darkkhaki), its analogous colors are #9CC1FF and #E5A9EA, and its triadic partners are #FAAD7C and #6AD9BB. For text on top, black gives the higher contrast.

Color harmonies
HarmonyRotationColor
Complementary+180°#c1c973
Analogous−30°, +30°#9cc1ff#e5a9ea
Triadic+120°, +240°#faad7c#6ad9bb
Split-complementary+150°, +210°#e4bb69#95d493

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-300 is a cool color: its hue is 253° 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
plum#dda0dd6.8
thistle#d8bfd88.1
lightsteelblue#b0c4de8.2

Nearest Tailwind v4 colors

Nearest Tailwind v4 colors
ColorHEXΔE OK
purple-300#dab2ff3.1
indigo-300#a3b3ff4.5
fuchsia-300#f4a8ff7.3

Code snippets

Tailwind CSS
<div class="bg-violet-300 text-black">...</div>
<p class="text-violet-300 border-violet-300">...</p>
CSS
.element {
  color: var(--color-violet-300);
  background-color: oklch(81.1% 0.111 293.571);
  border-color: #c4b4ff;
  outline-color: rgb(196 180 255);
}
SwiftUI
import SwiftUI

extension Color {
  static let violet300 = Color(red: 0.769, green: 0.706, blue: 1.000)
}
Jetpack Compose
import androidx.compose.ui.graphics.Color

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

const violet300 = Color(0xFFC4B4FF);
Android XML
<!-- res/values/colors.xml -->
<color name="violet_300">#C4B4FF</color>

Frequently asked questions

What is the hex code for Tailwind violet-300?
In Tailwind CSS v4, violet-300 is oklch(81.1% 0.111 293.571), which converts to #C4B4FF (rgb(196, 180, 255)) in sRGB after gamut mapping, because the OKLCH value is outside sRGB. In Tailwind v3 the same name was #C4B5FD.
What is the difference between violet-300 in Tailwind v3 and v4?
v3 used the hex #C4B5FD; v4 redefined the palette in OKLCH as oklch(81.1% 0.111 293.571). In v3, violet-300 was #C4B5FD. 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 violet-300 in plain CSS?
Tailwind v4 defines every palette color as a theme variable, so in CSS you write var(--color-violet-300). By default Tailwind only emits the variables your project uses; @theme static emits all of them.
Can you use white text on violet-300?
White text on violet-300 has a contrast ratio of 1.85:1, which fails AA even for large text under WCAG 2.2. Black text reaches 11.31:1 and passes both AA and AAA. In APCA terms that is Lc −39.1 for white and Lc 69.0 for black.
Which CSS named color is closest to violet-300?
The closest is plum (#DDA0DD) at ΔE OK 6.8, followed by thistle and lightsteelblue.

Last reviewed by Arielton Oberek.