Pages

Topics

Tools

↑↓navigate↵openescclose
Time, Text & CSS

Color & Contrast

Convert colors between HEX, RGB, HSL, and OKLCH, and check WCAG 2.1 contrast against light and dark backgrounds.

Runs entirely in your browser — nothing you paste is uploaded.

HEX · rgb() · hsl()
#3B82F6
Popular developer palettes
Copy-ready formats
HEX
#3B82F6
RGB
rgb(59, 130, 246)
HSL
hsl(217, 91%, 60%)
OKLCH
oklch(62.3% 0.188 259.8)
WCAG 2.1 contrast
Sample textwhite
3.68 : 1AA normal failAA large passAAA fail
Sample textdark
5.41 : 1AA normal passAA large passAAA fail

Normal text needs 4.5 : 1 (AA) or 7 : 1 (AAA). Large text and UI borders need 3 : 1.

CSS variables
:root {
  --color-brand: #3B82F6;
  --color-brand-rgb: 59 130 246;
  --color-brand-hsl: hsl(217, 91%, 60%);
  --color-brand-oklch: oklch(62.3% 0.188 259.8);
}
Tailwind
@theme {
  --color-brand: #3B82F6;
}

text-brand bg-brand border-brand
text-[#3B82F6] bg-[#3B82F6]

WCAG contrast reference

quick reference
4.5 : 1
Minimum for normal body text at AA level, up to 24px regular or 18.66px bold.
3 : 1
AA minimum for large text and for UI component borders and icons.
7 : 1
AAA level for any text size; 4.5 : 1 is AAA for large text.
(L1 + 0.05) / (L2 + 0.05)
The contrast formula, where L is relative luminance with gamma correction.
#RRGGBBAA
Eight-digit hex adds an alpha channel; CSS rgb() uses 0-255 and a 0-1 alpha.
OKLCH
Perceptually uniform lightness and chroma, so equal steps look equal and hues keep contrast.
All React guides