Labs · Personal project
ContrastKit: color tools that start from "is it legible?"
A set of browser tools for people who need a palette to be accessible, not just pretty. I designed it for my own design system work and built it with Claude as a coding partner.
Why I built it
In design system work, contrast decisions happen everywhere: when choosing a palette, naming tokens, checking a state. The tools I had each solved a piece of the problem, and few of them checked legibility at the moment the color is chosen.
ContrastKit is inspired by the WebAIM Contrast Checker and Coolors, with one difference in principle: every tool first answers "is this legible?" and only then "is this pretty?".
What it does
Everything runs in the browser, with no account and no server. It installs as an app and keeps working offline.
Contrast checker
Tests a text and background pair against WCAG 2.x and APCA, with a color-blindness preview and a suggestion for a color that passes AA.
Palette matrix
Shows the contrast of every pair in a palette, flags pairs that become indistinguishable for color-blind users, and exports to CSS, Tailwind and W3C design tokens.
Tonal scales
Generates a 50 to 950 scale from one color in OKLCH, with each step's contrast against white and black.
Image picker and mockups
Extracts a palette from a photo and applies it to real UI layouts, with a contrast badge on each one.
The accessibility angle
- The verdict appears where the color decision is made, not on a separate page.
- Two models side by side: WCAG 2.x for conformance today and APCA for what comes with WCAG 3.
- Distinguishability, not just contrast: under color-blindness simulation the matrix flags pairs no ratio would catch.
- The app passes its own test: all interface text, in both themes, meets AA, checked by a script.
Built with AI, on purpose
I want to be clear about this: I built ContrastKit with Claude as a coding partner. The decisions are mine; the implementation was shared.
What I did
- Wrote the spec first: audience, stack, page structure and the build phases, from the WCAG core to APCA, tokens and palettes.
- Decided what each tool should and should not do, and what to explain on screen.
- Reviewed every change and tested it in the browser.
- Made the trade-offs. When it became an offline-capable app, I moved Tailwind from a runtime CDN script to a locally compiled stylesheet, and wrote down why.
What Claude did
- Wrote and refactored code from that spec, and proposed approaches I could accept or push back on.
- Helped write the tests and the documentation, in English and Portuguese.
How I kept it trustworthy
The pure modules (color parsing, WCAG, APCA, OKLCH, exports) have automated tests, and APCA is checked against the reference examples from its authors. Anything that depends on the page was verified in the browser. AI speeds up the building; it doesn't replace checking the result.