Tailwind CSS v3 color

Tailwind gray-400 #9CA3AF

Tailwind CSS v3's gray-400 is #9CA3AF. It is a gray in the neutral family. In OKLCH it sits at lightness 0.714 with chroma 0.019, too low for hue to matter. The nearest CSS named color is darkgray (#A9A9A9), ΔE2000 6.4 away.

Relative luminance
0.3636
OKLCH L · C · h
0.714 · 0.019 · 261.3
Best text
Black 8.27:1
Hue family
Neutral

#9CA3AF color codes

HEX
#9CA3AF
RGB
rgb(156, 163, 175)
HSL
hsl(218, 11%, 65%)
OKLCH
oklch(0.714 0.019 261.3)
OKLab
oklab(0.714 -0.003 -0.019)
CIELAB (D65)
L* 66.79, a* -0.04, b* -7.05
XYZ (D65)
X 34.54, Y 36.36, Z 45.75
CMYK (naive)
cmyk(11%, 7%, 0%, 31%)

CIELAB and XYZ use the D65 white point; CSS lab() uses D50, so paste the OKLCH or HEX value into stylesheets. CMYK here is a plain formula with no press profile.

Legibility

Contrast: is #9CA3AF accessible?

Black text on it reaches 8.27:1, passing AAA. White text fails at 2.53:1.

WCAG 2 gives the same ratio whichever color is the text; APCA does not, so its Lc changes sign and size with polarity.

Open the Contrast System
  • Black text on it

    8.27:1

    • AA passes
    • AA large passes
    • AAA passes
    • APCA Lc +54
  • White text on it

    2.53:1

    • AA fails
    • AA large fails
    • AAA fails
    • APCA Lc −54
  • As text on black

    8.27:1

    • AA passes
    • AA large passes
    • AAA passes
    • APCA Lc −52
  • As text on white

    2.53:1

    • AA fails
    • AA large fails
    • AAA fails
    • APCA Lc +49

Nearest versions that pass 4.5:1

  • For text on white

    #6F7681 4.58:1

    Darkening its OKLCH lightness from 0.71 to 0.56 reaches 4.58:1 on white, keeping the hue.

  • For text on black

    #9CA3AF 8.27:1

    It already reaches 8.27:1 on black, so no change is needed.

Checking another pair? Use the Contrast Checker.

Studio

Adjust #9CA3AF live

Move lightness, chroma and hue in OKLCH, or drag on the map. The map is every lightness and chroma at the current hue: sRGB inside the solid area, Display P3 out to the dashed line.

The studio needs JavaScript.

Scale

Shades and tints of #9CA3AF

Eleven OKLCH lightness steps at this hue, each with its contrast against white and black. #9CA3AF sits at step 400.

  1. 50#F0F5FF
    White
    1.09
    Black
    19.21
  2. 100#E5ECF6
    White
    1.18
    Black
    17.66
  3. 200#D1D8E3
    White
    1.43
    Black
    14.64
  4. 300#B7BECA
    White
    1.86
    Black
    11.23
  5. 400This color#9CA3AF
    White
    2.53
    Black
    8.27
  6. 500#808792
    White
    3.62
    Black
    5.79
  7. 600#696F7A
    White
    5.05
    Black
    4.15
  8. 700#525863
    White
    7.15
    Black
    2.93
  9. 800#3B4049
    White
    10.41
    Black
    2.01
  10. 900#242931
    White
    14.61
    Black
    1.43
  11. 950#12161D
    White
    18.13
    Black
    1.15

Under each step, white and black text on it; a bold figure passes 4.5:1.

Tailwind CSS v3 gray scale

The real Tailwind palette, for comparison with the computed ramp above.

  1. 50#F9FAFB
    White
    1.04
    Black
    20.09
  2. 100#F3F4F6
    White
    1.10
    Black
    19.08
  3. 200#E5E7EB
    White
    1.23
    Black
    16.96
  4. 300#D1D5DB
    White
    1.47
    Black
    14.25
  5. 400This color#9CA3AF
    White
    2.53
    Black
    8.27
  6. 500#6B7280
    White
    4.83
    Black
    4.34
  7. 600#4B5563
    White
    7.55
    Black
    2.77
  8. 700#374151
    White
    10.30
    Black
    2.03
  9. 800#1F2937
    White
    14.67
    Black
    1.43
  10. 900#111827
    White
    17.73
    Black
    1.18
  11. 950#030712
    White
    20.13
    Black
    1.04

Gamut

How vivid #9CA3AF can get

A gray has no hue, so no gamut holds a more vivid version of #9CA3AF: more chroma would make it another color.

0.00.20.40.60.80.20.40.60.8 460480500520540560580600620
  • sRGB
  • Display P3
  • Rec. 2020
  • Dominant wavelength
OKLCH chroma
0.019
sRGB edge
No hue
Display P3 edge
No hue
Rec. 2020 edge
No hue
Dominant wavelength
477 nm
Excitation purity
8%
Chromaticity
x 0.2961, y 0.3117

Mixing

Mixing #9CA3AF

Each row is the same mix worked out in a different space, with the halfway color at its end. sRGB, which older CSS gradients use, can sag gray or dark in the middle; OKLab keeps the lightness steps even; OKLCH holds chroma and hue as it goes.

White #FFFFFF

  • sRGB50%#CED1D7
  • OKLab50%#CCD0D6
  • OKLCH50%#CCD0D6

Black #000000

  • sRGB50%#4E5258
  • OKLab50%#393C41
  • OKLCH50%#393C41
In CSS
/* A gradient and a mix, worked out in OKLCH */
background: linear-gradient(in oklch, #9ca3af, white);
color: color-mix(in oklch, #9ca3af 50%, white);

In use

#9CA3AF in an interface

A button, a link, a heading, a focused field, an icon and a chart line in this color, on a light page and a dark one. Each check is a WCAG 2 contrast minimum: 1.4.3 for text, 1.4.11 for the rest.

Light page

  • Button labelText, 4.5:18.27:1 Passes
  • Link and body-size textText, 4.5:12.53:1 Fails
  • Large headingLarge text, 3:12.53:1 Fails
  • Icons, borders and focus ringsNon-text, 3:12.53:1 Fails

For text on this page, the nearest shade that passes is #6F7681 4.58:1

Dark page

  • Button labelText, 4.5:18.27:1 Passes
  • Link and body-size textText, 4.5:17.37:1 Passes
  • Large headingLarge text, 3:17.37:1 Passes
  • Icons, borders and focus ringsNon-text, 3:17.37:1 Passes

Color vision

How #9CA3AF looks with color blindness

As a neutral it barely changes under any simulation, ΔE2000 6.5 at most.

Simulated with Machado et al. (2009) at full severity, in linear light.

Simulate a whole page What each type sees
  • Protanopia

    No working red (long-wavelength) cones

    #9FA3B0 ΔE2000 1.7

    Very close

    Reads as gray

  • Deuteranopia

    No working green (medium-wavelength) cones

    #9EA2AF ΔE2000 1.7

    Very close

    Reads as gray

  • Tritanopia

    No working blue (short-wavelength) cones

    #98A5A7 ΔE2000 6.5

    Noticeable

    Reads as gray

  • Achromatopsia

    No cone color vision; lightness only

    #A2A2A2 ΔE2000 6.1

    Noticeable

    Reads as gray

Pairing check

A near-neutral has no complementary hue to pair with, so tell it apart from neighboring grays by lightness contrast alone.

Harmony

Color harmonies for #9CA3AF

A neutral has no hue to rotate, so every harmony collapses back to the same gray. Pair it with an accent color instead.

Or pair it by lightness: steps of its own scale as text on it, and what each can carry.

Build a lightness scale in Harmony Studio
  • Step 950 #12161D · 7.14:1

    Body text, AAA

  • Step 700 #525863 · 2.81:1

    Decoration only, under 3:1

  • Step 300 #B7BECA · 1.35:1

    Decoration only, under 3:1

Code

Design tokens

Ready-to-paste tokens in six formats. Rename them to fit your system.

CSS custom property

:root {
  --color-gray-400: #9ca3af;
}

Tailwind config

// tailwind.config.js — already built in as gray-400;
// pin the v3 value explicitly like this:
module.exports = {
  theme: {
    extend: {
      colors: {
        gray: { 400: '#9ca3af' },
      },
    },
  },
};

Tailwind v4 theme

/* app.css — Tailwind CSS v4 */
@import "tailwindcss";

@theme {
  /* v4 has its own gray-400; this pins the v3 value. */
  --color-gray-400: oklch(0.714 0.019 261.3);
}

Design token (W3C DTCG)

{
  "color": {
    "gray-400": {
      "$type": "color",
      "$value": {
        "colorSpace": "srgb",
        "components": [0.6118, 0.6392, 0.6863],
        "hex": "#9ca3af"
      },
      "$description": "Tailwind CSS v3 gray-400"
    }
  }
}

SwiftUI color

import SwiftUI

enum Palette {
    static let gray400 = Color(.sRGB, red: 0.612, green: 0.639, blue: 0.686, opacity: 1)
}

Jetpack Compose color

import androidx.compose.ui.graphics.Color

object Palette {
    val Gray400 = Color(0xFF9CA3AF)
}

Matches

The nearest match in each system

The closest CSS name, Tailwind shade, RAL Classic paint and Crayola crayon by ΔE2000; under 2 is hard to tell apart side by side. RAL and Crayola values approximate physical colors.

Tools

Open #9CA3AF in the tools

Each opens over this page. More colors live in the Color Library, and every color page is listed on the hub.