What I Build
Production-Ready Tools
Tools Used by Developers Worldwide
Get Early Access to New Tools
Be the first to try new APIs and applications. No noise. Only meaningful releases and practical engineering insights.
Latest Engineering Articles
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.
Converting colors in Python is a fascinating mix of dictionary lookups (for names like "tomato") and coordinate geometry. While we can use the built-in `colorsys` module for some parts, we'll need the `webcolors` library to handle CSS names and some custom math to reach the more "exotic" formats like **HWB** and **CMYK**.
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.

About
I build backend systems and practical tools used by developers and businesses. This site is a collection of my production-ready APIs, open-source projects, engineering insights and practical guides that solve real-world problems.


