Configuration
Swatch Palettes
Primary - 0°
- Swatch 0
- Swatch 100
- Swatch 200
- Swatch 300
- Swatch 400
- Swatch 500
- Swatch 600
- Swatch 700
- Swatch 800
- Swatch 900
- Swatch 1000
This tool creates color palettes using the OKLab color space. The primary palette is defined in cylindrical (LCH) terms by specifying a Hue angle and Chroma (intensity) value. Lightness values are evenly distributed across a variable number of swatches.
Color harmonies are based on the primary palette. The tool generates complementary, split-complementary, triadic, tetradic, and analogous palettes. Each harmony is defined by an angle offset from the primary palette.
Text colors are provided for each background swatch, based on the WCAG 2.1 contrast ratio. The text color is either black or white, depending on which provides better contrast. It does not guarantee readability, but it should be a good starting point. (This feature is only visible on desktop browsers.)
The tool generates CSS custom properties for each color in the palette, so you can easily use the colors in web projects. The tool also generates fallback colors in sRGB for browsers that do not support the OKlab color space. The fallback colors are included in the CSS output.
See the code on Github.