Skip to content

Tailwind CSS v4 default palette

Tailwind neutral-900: #171717

In Tailwind CSS v4, neutral-900 is defined as --color-neutral-900: oklch(20.5% 0 none), which is #171717 in hex and rgb(23, 23, 23): a very dark neutral gray. In Tailwind v3, neutral-900 was #171717.

neutral-900#171717

In OKLCH, neutral-900 has a lightness of 20.5% and zero chroma: a gray with no hue at all.

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

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

Tailwind neutral is a true gray: its OKLCH chroma is zero in every shade, so it has no hue at all.

Color codes for neutral-900

Color codes for neutral-900
Tailwind v4 token--color-neutral-900
OKLCH (source value)oklch(20.5% 0 none)
HEX#171717
RGBrgb(23, 23, 23)
HSLhsl(0, 0%, 9%)
HWBhwb(0 9% 91%)
CMYK (naive, no ICC profile)cmyk(0%, 0%, 0%, 91%)
Decimal1,513,239
Tailwind v3 hex#171717
Utility classesbg-neutral-900, text-neutral-900, border-neutral-900

Tailwind neutral scale

Contrast and accessibility

On neutral-900, white text has a contrast ratio of 17.92:1 and passes AAA at any text size; black text reaches 1.17: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 neutral-9001.17:1FailFailFailFail0.0
White text on neutral-90017.92:1PassPassPassPass−106.9
Neutral-900 text on white17.92:1PassPassPassPass104.7
Neutral-900 text on black1.17:1FailFailFailFail0.0

Tints and shades

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

Tints (mixed with white)

  1. 5%
    #232323
  2. 15%
    #3a3a3a
  3. 25%
    #515151
  4. 35%
    #686868
  5. 45%
    #7f7f7f
  6. 55%
    #979797
  7. 65%
    #aeaeae
  8. 75%
    #c5c5c5
  9. 85%
    #dcdcdc
  10. 95%
    #f3f3f3

Shades (mixed with black)

  1. 5%
    #161616
  2. 15%
    #141414
  3. 25%
    #111111
  4. 35%
    #0f0f0f
  5. 45%
    #0d0d0d
  6. 55%
    #0a0a0a
  7. 65%
    #080808
  8. 75%
    #060606
  9. 85%
    #030303
  10. 95%
    #010101

Color harmonies

Rotating the hue in OKLCH while keeping lightness and chroma, neutral-900's complementary color is #171717 (close to midnightblue), its analogous colors are #171717 and #171717, and its triadic partners are #171717 and #171717. For text on top, white gives the higher contrast.

Color harmonies
HarmonyRotationColor
Complementary+180°#171717
Analogous−30°, +30°#171717#171717
Triadic+120°, +240°#171717#171717
Split-complementary+150°, +210°#171717#171717

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 neutral-900 is close to neutral: its OKLCH chroma is only 0.000, so its temperature comes from context. It has no perceptible hue.

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#19197016.6
navy#00008019.9
darkslategray#2f4f4f20.2

Nearest Tailwind v4 colors

Nearest Tailwind v4 colors
ColorHEXΔE OK
zinc-900#18181b0.8
stone-900#1c19171.3
taupe-900#1d18161.3

Code snippets

Tailwind CSS
<div class="bg-neutral-900 text-white">...</div>
<p class="text-neutral-900 border-neutral-900">...</p>
CSS
.element {
  color: var(--color-neutral-900);
  background-color: oklch(20.5% 0 none);
  border-color: #171717;
  outline-color: rgb(23 23 23);
}
SwiftUI
import SwiftUI

extension Color {
  static let neutral900 = Color(red: 0.090, green: 0.090, blue: 0.090)
}
Jetpack Compose
import androidx.compose.ui.graphics.Color

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

const neutral900 = Color(0xFF171717);
Android XML
<!-- res/values/colors.xml -->
<color name="neutral_900">#171717</color>

Frequently asked questions

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

Last reviewed by Arielton Oberek.