Skip to Content
Getting startedFoundationsComponentsPackagesTools

Compare colours

How far apart two colours look, and whether one can carry text on the other.

Two questions about a pair. Distance is whether a person can tell them apart, measured as CIEDE2000, where about 1 is the smallest visible difference. Contrast is whether one can carry text on the other, measured by WCAG 2. A pair can be easy to tell apart and still fail as text.

Hex, rgb() or oklch().
Hex, rgb() or oklch().
#7653AB
#A98FCF
ΔE 21.21

Distinct

Distance, ΔE 2000
21.21

Clearly two colours. CIEDE2000 measures how far apart two colours look rather than how far apart their numbers are, so about 1 is the smallest difference a person can see.

Contrast, WCAG 2
2.09:1
  • AA, body text4.5:1Fail
  • AAA, body text7:1Fail
  • AA large, 18pt, or 14pt bold3:1Fail
First on secondThe quick brown fox jumps over the lazy dog.
Second on firstThe quick brown fox jumps over the lazy dog.

This is @hipuku/colour running in the page, the same functions the contrast tests use. Nothing is uploaded.