Reasonable Colors is an open-source color system for building accessible, nice-looking color palettes.
Reasonable Colors is free and open source.
The annotated source-code is available on Github (mirrored on Gitlab) and released under the MIT license. Anyone can use these colors for anything.
Reasonable colors are accessible.
The color system was purpose-built for creating accessible, high-contrast color combinations.
WCAG 2 Contrast Recommendations and Colors Shades
It's simple to use Reasonable Colors to meet WCAG 2 contrast recommendations. Each color comes in 6, numbered shades. The contrast between any two shades can be inferred by the difference between their shade numbers.
Read more about accessible color contrast on MDN.
Contrast ratio ≥ 3:1: shade difference of 2
The contrast between any shades with a difference of 2 (shade-2 and shade-4, for example) will be at least 3:1.
✓ WCAG 2 AA contrast for icons and graphics
Contrast ratio ≥ 4.5:1: shade difference of 3
The contrast between any shades with a difference of 3 (shade-2 and shade-5, for example) will be at least 4.5:1.
✓ WCAG 2 AAA contrast for large text
Contrast ratio ≥ 7:1: shade difference of 4
The contrast between any shades with a difference of 4 (shade-2 and shade-6, for example) will be at least 7:1.
The Fun Part
And here's the really fun part – because this is all built within the LCH color space and the relative luminance for each shade is pinned within certain ranges, those contrast rules work across all 24 color sets. Mix and match shades from any color, even the grays.
Reasonable colors are easy to use.
The 24 sets of named colors are uniformly spaced, each hue is 15° apart from its neighbors on the LCH color wheel. This uniform spacing makes it simple to find complimentary pairs and build nice-looking color palettes.
Getting Started
Reasonable Colors defines a set of CSS variables that follow this format:
--color-COLORNAME-SHADE
/* Example */ code { background-color: var(--color-magenta-2);
The simplest way to get started is to include the single CSS file:
<link rel="stylesheet" href="https://unpkg.com/reasonable-colors@0.4.0/reasonable-colors.css">
Or install via NPM:
npm install reasonable-colors
Other Color Spaces
For simplicity, the default Reasonable Colors CSS variables use hex values to define the colors. But, both HSL and RGB CSS variables are also available:
<link rel="stylesheet" href="https://unpkg.com/reasonable-colors@0.4.0/reasonable-colors-hsl.css">
<link rel="stylesheet" href="https://unpkg.com/reasonable-colors@0.4.0/reasonable-colors-rgb.css">
Support for LCH Color
Sometime in the near future, web browsers will begin to support wide gamut color spaces. Since Reasonable Colors was built using the LCH color space, it's ready for this day and already provides LCH CSS variables.
<link rel="stylesheet" href="https://unpkg.com/reasonable-colors@0.4.0/reasonable-colors-lch.css">
SCSS Variables
A corresponding .scss file (for each color space) is provided with SCSS variable declarations.
Help Contribute
Have a better name for a color? Notice a silly or a serious mistake? Have ideas to improve the project? Kindly let me know! Discuss on Twitter @matthewhowell, open an issue on Github, or even send an email.
Support
Reasonable Colors is and forever will be free and open source. Contributing and sharing the project are both great, free ways to support it.
Read how to financially support Reasonable Colors
The easiest way to financially support Reasonable Company's open-source work is to make a small donation.
Thanks and Acknowledgements
Like nearly everything, this couldn't have been made without the generous work of many other humans. An incomplete list of helpers:
- Lea Verou's lovely introduction to LCH color on the web
- George Francis' approachable tutorial for selecting colors programmatically
- Everyone at Moqups who works on Culori, a splendid JS color library
- The undefatigable MDN Web Docs, the best web docs
- U.S. Web Design System docs, which do a wonderful job of explaining their design decisions