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.
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
| Tailwind v4 token | --color-violet-300 |
|---|---|
| OKLCH (source value) | oklch(81.1% 0.111 293.571) |
| HEX | #C4B4FF |
| RGB | rgb(196, 180, 255) |
| HSL | hsl(253, 100%, 85%) |
| HWB | hwb(253 71% 0%) |
| CMYK (naive, no ICC profile) | cmyk(23%, 29%, 0%, 0%) |
| Decimal | 12,891,391 |
| Display P3 | color(display-p3 0.7589 0.7063 0.9917) |
| Tailwind v3 hex | #C4B5FD |
| Utility classes | bg-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.
| Pair | Ratio | AA | AA large | AAA | AAA large | APCA Lc |
|---|---|---|---|---|---|---|
| Black text on violet-300 | 11.31:1 | Pass | Pass | Pass | Pass | 69.0 |
| White text on violet-300 | 1.85:1 | Fail | Fail | Fail | Fail | −39.1 |
| Violet-300 text on white | 1.85:1 | Fail | Fail | Fail | Fail | 34.9 |
| Violet-300 text on black | 11.31:1 | Pass | Pass | Pass | Pass | −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)
- 5%
#c7b8ff - 15%
#cdbfff - 25%
#d3c7ff - 35%
#d9ceff - 45%
#dfd6ff - 55%
#e4ddff - 65%
#eae5ff - 75%
#f0ecff - 85%
#f6f4ff - 95%
#fcfbff
Shades (mixed with black)
- 5%
#baabf2 - 15%
#a799d9 - 25%
#9387bf - 35%
#7f75a6 - 45%
#6c638c - 55%
#585173 - 65%
#453f59 - 75%
#312d40 - 85%
#1d1b26 - 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.
| Harmony | Rotation | Color |
|---|---|---|
| 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
| Color | HEX | ΔE OK |
|---|---|---|
| plum | #dda0dd | 6.8 |
| thistle | #d8bfd8 | 8.1 |
| lightsteelblue | #b0c4de | 8.2 |
Nearest Tailwind v4 colors
| Color | HEX | ΔE OK |
|---|---|---|
| purple-300 | #dab2ff | 3.1 |
| indigo-300 | #a3b3ff | 4.5 |
| fuchsia-300 | #f4a8ff | 7.3 |
Code snippets
<div class="bg-violet-300 text-black">...</div>
<p class="text-violet-300 border-violet-300">...</p>.element {
color: var(--color-violet-300);
background-color: oklch(81.1% 0.111 293.571);
border-color: #c4b4ff;
outline-color: rgb(196 180 255);
}import SwiftUI
extension Color {
static let violet300 = Color(red: 0.769, green: 0.706, blue: 1.000)
}import androidx.compose.ui.graphics.Color
val Violet300 = Color(0xFFC4B4FF)import 'package:flutter/material.dart';
const violet300 = Color(0xFFC4B4FF);<!-- 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.