Skip to content

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.

gray-400#99A1AF

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

Color codes for gray-400
Tailwind v4 token--color-gray-400
OKLCH (source value)oklch(70.7% 0.022 261.325)
HEX#99A1AF
RGBrgb(153, 161, 175)
HSLhsl(218, 12%, 64%)
HWBhwb(218 60% 31%)
CMYK (naive, no ICC profile)cmyk(13%, 8%, 0%, 31%)
Decimal10,068,399
Tailwind v3 hex#9CA3AF
Utility classesbg-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.

Contrast and accessibility
PairRatioAAAA largeAAAAAA largeAPCA Lc
Black text on gray-4008.07:1PassPassPassPass53.2
White text on gray-4002.60:1FailFailFailFail−56.0
Gray-400 text on white2.60:1FailFailFailFail50.8
Gray-400 text on black8.07:1PassPassPassPass−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)

  1. 5%
    #9ea6b3
  2. 15%
    #a8afbb
  3. 25%
    #b3b9c3
  4. 35%
    #bdc2cb
  5. 45%
    #c7cbd3
  6. 55%
    #d1d5db
  7. 65%
    #dbdee3
  8. 75%
    #e6e8eb
  9. 85%
    #f0f1f3
  10. 95%
    #fafafb

Shades (mixed with black)

  1. 5%
    #9199a6
  2. 15%
    #828995
  3. 25%
    #737983
  4. 35%
    #636972
  5. 45%
    #545960
  6. 55%
    #45484f
  7. 65%
    #36383d
  8. 75%
    #26282c
  9. 85%
    #17181a
  10. 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.

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

Nearest CSS named colors

Nearest CSS named colors
ColorHEXΔE OK
darkgray#a9a9a93.5
rosybrown#bc8f8f6.9
cadetblue#5f9ea07.6

Nearest Tailwind v4 colors

Nearest Tailwind v4 colors
ColorHEXΔE OK
zinc-400#9f9fa91.1
slate-400#90a1b91.8
mauve-400#a89ea92.2

Code snippets

Tailwind CSS
<div class="bg-gray-400 text-black">...</div>
<p class="text-gray-400 border-gray-400">...</p>
CSS
.element {
  color: var(--color-gray-400);
  background-color: oklch(70.7% 0.022 261.325);
  border-color: #99a1af;
  outline-color: rgb(153 161 175);
}
SwiftUI
import SwiftUI

extension Color {
  static let gray400 = Color(red: 0.600, green: 0.631, blue: 0.686)
}
Jetpack Compose
import androidx.compose.ui.graphics.Color

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

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