Skip to main content

2 posts tagged with "accessibility"

accessibility tag description

View All Tags

How to create a 5-color palette where EVERY color is readable against EVERY other color with Python

· 6 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

Creating a color palette where every color is readable against every other color is a high-level design challenge. As the number of colors in your palette increases, the "contrast space" shrinks significantly.

In this article, we’ll build a script that uses an iterative "Collision-Check" algorithm. It generates a candidate color, checks it against every color already in the palette, and only keeps it if it passes the WCAG AA threshold against all of them.

Contrast Checker: How to Calculate Color Contrast in Python

· 6 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

Designing a beautiful UI is pointless if half your users can't read it. Whether it's a person with a visual impairment or someone trying to check their phone on a sunny day, color contrast is the secret sauce of accessible design.

The WCAG (Web Content Accessibility Guidelines) provides a mathematical way to ensure text stands out against its background. Let's integrate a "Contrast Checker" into our Python toolkit.