Open source

Grain

Color tokens that pass contrast checks by construction, for any brand color.

Client
Open source
Role
Maintainer
Year
2023
Duration
Since 2023
A row of sharpened coloured pencils of different lengths

Results

GitHub stars
3.4k
Weekly downloads
21k
Contributors
46

The challenge

Every design system I joined had a palette that looked right and failed contrast in one theme. Fixing it by hand took days and broke again with the next brand refresh.

The approach

Grain takes one brand color and builds a full scale in OKLCH, then checks every text and surface pair against WCAG and nudges lightness until each one passes.

It runs in CI, so a pull request that breaks contrast fails before review.

What I built

  • Light and dark scales from one color.
  • A contrast report for every pair a theme uses.
  • A CLI and a CI check, no browser needed.

More work

  • Web app · Lead engineer

    Harbor Booking

    A booking flow for a small marina, from berth search to payment.

    • Next.js
    • Postgres
    • Stripe
  • Mobile · Frontend lead

    Platform

    Live departures and disruption alerts for a regional rail network.

    • React Native
    • TypeScript
    • GraphQL