Skip to content

Tailwind CSS v4 default palette

Tailwind gray-900: #101828

In Tailwind CSS v4, gray-900 is defined as --color-gray-900: oklch(21% 0.034 264.665), which is #101828 in hex and rgb(16, 24, 40): a very dark, grayish blue. In Tailwind v3, gray-900 was #111827.

gray-900#101828

In OKLCH, gray-900 has a lightness of 21.0%, chroma 0.034 and hue 264.7°.

The value fits inside sRGB, so the hex #101828 represents it without loss on any screen.

In v3, gray-900 was #111827. The v4 value is ΔE OK 0.2 away, below the point where most people can tell them apart.

Tailwind gray is a cool gray with a lighter blue tint than slate, the default neutral in many Tailwind projects.

Color codes for gray-900

Color codes for gray-900
Tailwind v4 token--color-gray-900
OKLCH (source value)oklch(21% 0.034 264.665)
HEX#101828
RGBrgb(16, 24, 40)
HSLhsl(220, 43%, 11%)
HWBhwb(220 6% 84%)
CMYK (naive, no ICC profile)cmyk(60%, 40%, 0%, 84%)
Decimal1,054,760
Tailwind v3 hex#111827
Utility classesbg-gray-900, text-gray-900, border-gray-900

Tailwind gray scale

Contrast and accessibility

On gray-900, white text has a contrast ratio of 17.74:1 and passes AAA at any text size; black text reaches 1.18: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-9001.18:1FailFailFailFail0.0
White text on gray-90017.74:1PassPassPassPass−106.7
Gray-900 text on white17.74:1PassPassPassPass104.5
Gray-900 text on black1.18:1FailFailFailFail0.0

Tints and shades

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

Tints (mixed with white)

  1. 5%
    #1c2433
  2. 15%
    #343b48
  3. 25%
    #4c525e
  4. 35%
    #646973
  5. 45%
    #7c8089
  6. 55%
    #93979e
  7. 65%
    #abaeb4
  8. 75%
    #c3c5c9
  9. 85%
    #dbdcdf
  10. 95%
    #f3f3f4

Shades (mixed with black)

  1. 5%
    #0f1726
  2. 15%
    #0e1422
  3. 25%
    #0c121e
  4. 35%
    #0a101a
  5. 45%
    #090d16
  6. 55%
    #070b12
  7. 65%
    #06080e
  8. 75%
    #04060a
  9. 85%
    #020406
  10. 95%
    #010102

Color harmonies

Rotating the hue in OKLCH while keeping lightness and chroma, gray-900's complementary color is #1F1705 (close to midnightblue), its analogous colors are #061B26 and #191526, and its triadic partners are #261210 and #0E1C0E. For text on top, white gives the higher contrast.

Color harmonies
HarmonyRotationColor
Complementary+180°#1f1705
Analogous−30°, +30°#061b26#191526
Triadic+120°, +240°#261210#0e1c0e
Split-complementary+150°, +210°#241408#181a07

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-900 is a cool color: its hue is 220° 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
midnightblue#19197013.5
navy#00008016.6
darkblue#00008b18.3

Nearest Tailwind v4 colors

Nearest Tailwind v4 colors
ColorHEXΔE OK
slate-900#0f172b0.8
zinc-900#18181b2.8
mauve-900#1d161e2.9

Code snippets

Tailwind CSS
<div class="bg-gray-900 text-white">...</div>
<p class="text-gray-900 border-gray-900">...</p>
CSS
.element {
  color: var(--color-gray-900);
  background-color: oklch(21% 0.034 264.665);
  border-color: #101828;
  outline-color: rgb(16 24 40);
}
SwiftUI
import SwiftUI

extension Color {
  static let gray900 = Color(red: 0.063, green: 0.094, blue: 0.157)
}
Jetpack Compose
import androidx.compose.ui.graphics.Color

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

const gray900 = Color(0xFF101828);
Android XML
<!-- res/values/colors.xml -->
<color name="gray_900">#101828</color>

Frequently asked questions

What is the hex code for Tailwind gray-900?
In Tailwind CSS v4, gray-900 is oklch(21% 0.034 264.665), which converts to #101828 (rgb(16, 24, 40)) in sRGB. In Tailwind v3 the same name was #111827.
What is the difference between gray-900 in Tailwind v3 and v4?
v3 used the hex #111827; v4 redefined the palette in OKLCH as oklch(21% 0.034 264.665). In v3, gray-900 was #111827. The v4 value is ΔE OK 0.2 away, below the point where most people can tell them apart.
How do I use gray-900 in plain CSS?
Tailwind v4 defines every palette color as a theme variable, so in CSS you write var(--color-gray-900). By default Tailwind only emits the variables your project uses; @theme static emits all of them.
Can you use white text on gray-900?
White text on gray-900 has a contrast ratio of 17.74:1, which passes both AA and AAA under WCAG 2.2. Black text reaches 1.18:1 and fails AA even for large text. In APCA terms that is Lc −106.7 for white and Lc 0.0 for black.
Which CSS named color is closest to gray-900?
The closest is midnightblue (#191970) at ΔE OK 13.5, followed by navy and darkblue.

Last reviewed by Arielton Oberek.