Skip to content

Tailwind CSS v4 default palette

Tailwind blue-500: #2B7FFF

In Tailwind CSS v4, blue-500 is defined as --color-blue-500: oklch(62.3% 0.214 259.815), which is #2B7FFF in hex and rgb(43, 127, 255): a medium, vivid blue. In Tailwind v3, blue-500 was #3B82F6.

blue-500#2B7FFF

In OKLCH, blue-500 has a lightness of 62.3%, chroma 0.214 and hue 259.8°.

This OKLCH value lies outside sRGB. The hex #2B7FFF is the sRGB fallback from the CSS Color 4 gamut mapping algorithm; on Display P3 screens browsers show a more saturated color, close to color(display-p3 0.2664 0.4912 0.9886).

In v3, blue-500 was #3B82F6. The v4 value is ΔE OK 2.6 away; v4 is more saturated.

Tailwind blue is the default for links, focus rings and primary buttons in many projects built on the framework.

Color codes for blue-500

Color codes for blue-500
Tailwind v4 token--color-blue-500
OKLCH (source value)oklch(62.3% 0.214 259.815)
HEX#2B7FFF
RGBrgb(43, 127, 255)
HSLhsl(216, 100%, 58%)
HWBhwb(216 17% 0%)
CMYK (naive, no ICC profile)cmyk(83%, 50%, 0%, 0%)
Decimal2,850,815
Display P3color(display-p3 0.2664 0.4912 0.9886)
Tailwind v3 hex#3B82F6
Utility classesbg-blue-500, text-blue-500, border-blue-500

Tailwind blue scale

Contrast and accessibility

On blue-500, black text has a contrast ratio of 5.58:1 and passes AA for normal text; white text reaches 3.76: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 blue-5005.58:1PassPassFailPass39.5
White text on blue-5003.76:1FailPassFailFail−70.0
Blue-500 text on white3.76:1FailPassFailFail64.5
Blue-500 text on black5.58:1PassPassFailPass−37.1

Tints and shades

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

Tints (mixed with white)

  1. 5%
    #3685ff
  2. 15%
    #4b92ff
  3. 25%
    #609fff
  4. 35%
    #75acff
  5. 45%
    #8ab9ff
  6. 55%
    #a0c5ff
  7. 65%
    #b5d2ff
  8. 75%
    #cadfff
  9. 85%
    #dfecff
  10. 95%
    #f4f9ff

Shades (mixed with black)

  1. 5%
    #2979f2
  2. 15%
    #256cd9
  3. 25%
    #205fbf
  4. 35%
    #1c53a6
  5. 45%
    #18468c
  6. 55%
    #133973
  7. 65%
    #0f2c59
  8. 75%
    #0b2040
  9. 85%
    #061326
  10. 95%
    #02060d

Color harmonies

Rotating the hue in OKLCH while keeping lightness and chroma, blue-500's complementary color is #B57A00 (close to darkgoldenrod), its analogous colors are #0095CE and #8A66FC, and its triadic partners are #EC384E and #25A300. For text on top, black gives the higher contrast.

Color harmonies
HarmonyRotationColor
Complementary+180°#b57a00
Analogous−30°, +30°#0095ce#8a66fc
Triadic+120°, +240°#ec384e#25a300
Split-complementary+150°, +210°#dc5900#8e8d00

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 blue-500 is a cool color: its hue is 216° 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
dodgerblue#1e90ff4.4
royalblue#4169e17.2
cornflowerblue#6495ed8.9

Nearest Tailwind v4 colors

Nearest Tailwind v4 colors
ColorHEXΔE OK
indigo-500#615fff7.9
indigo-400#7c86ff8.4
blue-600#155dfc8.4

Code snippets

Tailwind CSS
<div class="bg-blue-500 text-black">...</div>
<p class="text-blue-500 border-blue-500">...</p>
CSS
.element {
  color: var(--color-blue-500);
  background-color: oklch(62.3% 0.214 259.815);
  border-color: #2b7fff;
  outline-color: rgb(43 127 255);
}
SwiftUI
import SwiftUI

extension Color {
  static let blue500 = Color(red: 0.169, green: 0.498, blue: 1.000)
}
Jetpack Compose
import androidx.compose.ui.graphics.Color

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

const blue500 = Color(0xFF2B7FFF);
Android XML
<!-- res/values/colors.xml -->
<color name="blue_500">#2B7FFF</color>

Frequently asked questions

What is the hex code for Tailwind blue-500?
In Tailwind CSS v4, blue-500 is oklch(62.3% 0.214 259.815), which converts to #2B7FFF (rgb(43, 127, 255)) in sRGB after gamut mapping, because the OKLCH value is outside sRGB. In Tailwind v3 the same name was #3B82F6.
What is the difference between blue-500 in Tailwind v3 and v4?
v3 used the hex #3B82F6; v4 redefined the palette in OKLCH as oklch(62.3% 0.214 259.815). In v3, blue-500 was #3B82F6. The v4 value is ΔE OK 2.6 away; v4 is more saturated.
How do I use blue-500 in plain CSS?
Tailwind v4 defines every palette color as a theme variable, so in CSS you write var(--color-blue-500). By default Tailwind only emits the variables your project uses; @theme static emits all of them.
Can you use white text on blue-500?
White text on blue-500 has a contrast ratio of 3.76:1, which passes AA only for large text (24 px, or 18.66 px bold, and up) under WCAG 2.2. Black text reaches 5.58:1 and passes AA for normal text but not AAA. In APCA terms that is Lc −70.0 for white and Lc 39.5 for black.
Which CSS named color is closest to blue-500?
The closest is dodgerblue (#1E90FF) at ΔE OK 4.4, followed by royalblue and cornflowerblue.

Last reviewed by Arielton Oberek.