Tailwind CSS v4 default palette
Tailwind gray-400: #99A1AF
In Tailwind CSS v4, gray-400 is defined as --color-gray-400: oklch(70.7% 0.022 261.325), which is #99A1AF in hex and rgb(153, 161, 175): a light, grayish blue. In Tailwind v3, gray-400 was #9CA3AF.
In OKLCH, gray-400 has a lightness of 70.7%, chroma 0.022 and hue 261.3°.
The value fits inside sRGB, so the hex #99A1AF represents it without loss on any screen.
In v3, gray-400 was #9CA3AF. The v4 value is ΔE OK 0.7 away, below the point where most people can tell them apart; v4 is darker.
Tailwind gray is a cool gray with a lighter blue tint than slate, the default neutral in many Tailwind projects.
Color codes for gray-400
| Tailwind v4 token | --color-gray-400 |
|---|---|
| OKLCH (source value) | oklch(70.7% 0.022 261.325) |
| HEX | #99A1AF |
| RGB | rgb(153, 161, 175) |
| HSL | hsl(218, 12%, 64%) |
| HWB | hwb(218 60% 31%) |
| CMYK (naive, no ICC profile) | cmyk(13%, 8%, 0%, 31%) |
| Decimal | 10,068,399 |
| Tailwind v3 hex | #9CA3AF |
| Utility classes | bg-gray-400, text-gray-400, border-gray-400 |
Tailwind gray scale
Contrast and accessibility
On gray-400, black text has a contrast ratio of 8.07:1 and passes AAA at any text size; white text reaches 2.60: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 gray-400 | 8.07:1 | Pass | Pass | Pass | Pass | 53.2 |
| White text on gray-400 | 2.60:1 | Fail | Fail | Fail | Fail | −56.0 |
| Gray-400 text on white | 2.60:1 | Fail | Fail | Fail | Fail | 50.8 |
| Gray-400 text on black | 8.07:1 | Pass | Pass | Pass | Pass | −51.1 |
Tints and shades
Each step mixes var(--color-gray-400) with white (tints) or black (shades) in gamma-encoded sRGB, the same result as color-mix(in srgb, var(--color-gray-400), white 25%) in CSS.
Tints (mixed with white)
- 5%
#9ea6b3 - 15%
#a8afbb - 25%
#b3b9c3 - 35%
#bdc2cb - 45%
#c7cbd3 - 55%
#d1d5db - 65%
#dbdee3 - 75%
#e6e8eb - 85%
#f0f1f3 - 95%
#fafafb
Shades (mixed with black)
- 5%
#9199a6 - 15%
#828995 - 25%
#737983 - 35%
#636972 - 45%
#545960 - 55%
#45484f - 65%
#36383d - 75%
#26282c - 85%
#17181a - 95%
#080809
Color harmonies
Rotating the hue in OKLCH while keeping lightness and chroma, gray-400's complementary color is #A89F92 (close to darkgray), its analogous colors are #93A3AC and #A09EAE, and its triadic partners are #AE9B9B and #99A498. For text on top, black gives the higher contrast.
| Harmony | Rotation | Color |
|---|---|---|
| Complementary | +180° | #a89f92 |
| Analogous | −30°, +30° | #93a3ac#a09eae |
| Triadic | +120°, +240° | #ae9b9b#99a498 |
| Split-complementary | +150°, +210° | #ac9d94#a1a293 |
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 gray-400 is close to neutral: its OKLCH chroma is only 0.022, so its temperature comes from context. The faint 218° hue gives it a slightly cool cast.
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.
Code snippets
<div class="bg-gray-400 text-black">...</div>
<p class="text-gray-400 border-gray-400">...</p>.element {
color: var(--color-gray-400);
background-color: oklch(70.7% 0.022 261.325);
border-color: #99a1af;
outline-color: rgb(153 161 175);
}import SwiftUI
extension Color {
static let gray400 = Color(red: 0.600, green: 0.631, blue: 0.686)
}import androidx.compose.ui.graphics.Color
val Gray400 = Color(0xFF99A1AF)import 'package:flutter/material.dart';
const gray400 = Color(0xFF99A1AF);<!-- res/values/colors.xml -->
<color name="gray_400">#99A1AF</color>Frequently asked questions
- What is the hex code for Tailwind gray-400?
- In Tailwind CSS v4, gray-400 is oklch(70.7% 0.022 261.325), which converts to #99A1AF (rgb(153, 161, 175)) in sRGB. In Tailwind v3 the same name was #9CA3AF.
- What is the difference between gray-400 in Tailwind v3 and v4?
- v3 used the hex #9CA3AF; v4 redefined the palette in OKLCH as oklch(70.7% 0.022 261.325). In v3, gray-400 was #9CA3AF. The v4 value is ΔE OK 0.7 away, below the point where most people can tell them apart; v4 is darker.
- How do I use gray-400 in plain CSS?
- Tailwind v4 defines every palette color as a theme variable, so in CSS you write var(--color-gray-400). By default Tailwind only emits the variables your project uses; @theme static emits all of them.
- Can you use white text on gray-400?
- White text on gray-400 has a contrast ratio of 2.60:1, which fails AA even for large text under WCAG 2.2. Black text reaches 8.07:1 and passes both AA and AAA. In APCA terms that is Lc −56.0 for white and Lc 53.2 for black.
- Which CSS named color is closest to gray-400?
- The closest is darkgray (#A9A9A9) at ΔE OK 3.5, followed by rosybrown and cadetblue.
Last reviewed by Arielton Oberek.