Polychromav2.2.0

About

When defining a standard two-colour gradient, browsers interpolate using RGB, which can go through kind of greyish colours. Lab interpolation produces better, more even results.

Other interpolation modes (HSL and Lch for now, working on adding more) are included as options for experimentation — the results can be overly-saturated.

Background

The idea for Polychroma started after discovering Bugsnag’s chromatic-sass project. I loved the idea of a more natural-looking gradient, but I wanted a way to visualise the results without needing to update my dev stack.

I looked into the library that powered it — the amazing chroma.js — and after tumbling down a rabbit hole of colour science and data visualisation, ended up with this simple little tool. Use it to grab a quick CSS snippet, or plug the resulting colour values into Figma, Sketch, or your image editor of choice to use in mockups.

Colophon

Polychroma is built with Nuxt.js — a Vue.js framework — and chroma.js by Gregor Aisch.

It uses Tailwind CSS for most of the styling, with a few tweaks and custom styles.

The text is set in Inter, specifically the 400, 600, and 700 weights.

Comments & suggestions are very welcome! You can leave a message on Twitter or file an issue on GitHub.

linear-gradient(30deg, oklch(0.27 0.19 264) 0%, oklch(0.3778 0.1372 302.29) 16%, oklch(0.4924 0.0782 329.42) 33%, oklch(0.6103 0.0484 39.17) 50%, oklch(0.7297 0.093 89.074) 66%, oklch(0.8497 0.1523 103.47) 83%, oklch(0.97 0.21 110) 100%)