Contrast is accessibility, not aesthetics
Low-contrast text excludes people: those with low vision, color blindness, and anyone reading on a screen in sunlight. WCAG defines a minimum contrast ratio between text and background — the higher, the more legible.
The thresholds: normal text needs 4.5:1 for level AA and 7:1 for AAA. Large text (from ~18.66px bold or ~24px normal) can use 3:1 (AA) and 4.5:1 (AAA). UI components and essential icons need at least 3:1.
This calculation follows WCAG's official relative luminance formula and runs in your browser. It solves the contrast criterion — full accessibility involves much more (keyboard, screen readers, semantic structure), so treat this as a first filter.