Color Palette Generator: Harmonies and a 50-900 Scale from One Color
From the base #1e6bb8 (oklch(52.3% 0.1412 252.58)) the complementary color is #905e00, the triadic colors are #ab4053 and #487a0d, and a 50 to 900 tints and shades scale runs from #eef6ff to #122335. Hues are rotated and lightness is stepped in OKLCH, so the steps look even, and each swatch shows its hex, RGB, HSL and OKLCH values with its WCAG 2 contrast on white and black (#1e6bb8: 5.45:1 with white text, 3.85:1 with black). Type any CSS color or press Random, then copy the palette as CSS custom properties, a Tailwind config or JSON.
Updated Runs in your browser: nothing you enter is uploadedHow this tool works
Base color
Color harmonies
Press a swatch to copy its hex code. Hues are rotated in OKLCH.
Complementary
The base and the hue opposite it (180 degrees).
- RGB
- rgb(30, 107, 184)
- HSL
- hsl(210, 72%, 42%)
- OKLCH
- oklch(52.3% 0.1412 252.58)
- White text 5.45:1 AA pass AAA fail
- Black text 3.85:1 AA fail AAA fail
- RGB
- rgb(144, 94, 0)
- HSL
- hsl(39.2, 100%, 28.2%)
- OKLCH
- oklch(52.4% 0.1114 73.2)
- White text 5.54:1 AA pass AAA fail
- Black text 3.78:1 AA fail AAA fail
Analogous
The base and the hues 30 degrees either side of it.
- RGB
- rgb(0, 118, 146)
- HSL
- hsl(191.5, 100%, 28.6%)
- OKLCH
- oklch(52.4% 0.0969 221.95)
- White text 5.24:1 AA pass AAA fail
- Black text 4:1 AA fail AAA fail
- RGB
- rgb(30, 107, 184)
- HSL
- hsl(210, 72%, 42%)
- OKLCH
- oklch(52.3% 0.1412 252.58)
- White text 5.45:1 AA pass AAA fail
- Black text 3.85:1 AA fail AAA fail
- RGB
- rgb(96, 91, 184)
- HSL
- hsl(243.2, 39.6%, 53.9%)
- OKLCH
- oklch(52.3% 0.1422 282.73)
- White text 5.69:1 AA pass AAA fail
- Black text 3.68:1 AA fail AAA fail
Triadic
Three hues 120 degrees apart.
- RGB
- rgb(30, 107, 184)
- HSL
- hsl(210, 72%, 42%)
- OKLCH
- oklch(52.3% 0.1412 252.58)
- White text 5.45:1 AA pass AAA fail
- Black text 3.85:1 AA fail AAA fail
- RGB
- rgb(171, 64, 83)
- HSL
- hsl(349.3, 45.5%, 46.1%)
- OKLCH
- oklch(52.4% 0.1405 12.66)
- White text 5.84:1 AA pass AAA fail
- Black text 3.58:1 AA fail AAA fail
- RGB
- rgb(72, 122, 13)
- HSL
- hsl(87.5, 80.7%, 26.5%)
- OKLCH
- oklch(52.4% 0.1415 132.69)
- White text 5.16:1 AA pass AAA fail
- Black text 4.06:1 AA fail AAA fail
Split-complementary
The base and the two hues beside its complement (150 and 210 degrees).
- RGB
- rgb(30, 107, 184)
- HSL
- hsl(210, 72%, 42%)
- OKLCH
- oklch(52.3% 0.1412 252.58)
- White text 5.45:1 AA pass AAA fail
- Black text 3.85:1 AA fail AAA fail
- RGB
- rgb(170, 72, 25)
- HSL
- hsl(19.4, 74.4%, 38.2%)
- OKLCH
- oklch(52.4% 0.141 42.74)
- White text 5.75:1 AA pass AAA fail
- Black text 3.65:1 AA fail AAA fail
- RGB
- rgb(118, 108, 0)
- HSL
- hsl(54.9, 100%, 23.1%)
- OKLCH
- oklch(52.4% 0.1102 103.12)
- White text 5.36:1 AA pass AAA fail
- Black text 3.91:1 AA fail AAA fail
Tetradic (square)
Four hues 90 degrees apart.
- RGB
- rgb(30, 107, 184)
- HSL
- hsl(210, 72%, 42%)
- OKLCH
- oklch(52.3% 0.1412 252.58)
- White text 5.45:1 AA pass AAA fail
- Black text 3.85:1 AA fail AAA fail
- RGB
- rgb(158, 67, 128)
- HSL
- hsl(319.8, 40.4%, 44.1%)
- OKLCH
- oklch(52.3% 0.1411 342.18)
- White text 5.88:1 AA pass AAA fail
- Black text 3.56:1 AA fail AAA fail
- RGB
- rgb(144, 94, 0)
- HSL
- hsl(39.2, 100%, 28.2%)
- OKLCH
- oklch(52.4% 0.1114 73.2)
- White text 5.54:1 AA pass AAA fail
- Black text 3.78:1 AA fail AAA fail
- RGB
- rgb(0, 126, 86)
- HSL
- hsl(161, 100%, 24.7%)
- OKLCH
- oklch(52.4% 0.1142 162.45)
- White text 5.09:1 AA pass AAA fail
- Black text 4.11:1 AA fail AAA fail
Monochromatic
The base hue and chroma at five evenly spaced lightness steps.
- RGB
- rgb(0, 46, 90)
- HSL
- hsl(209.3, 100%, 17.6%)
- OKLCH
- oklch(30.1% 0.0917 252.62)
- White text 13.65:1 AA pass AAA pass
- Black text 1.53:1 AA fail AAA fail
- RGB
- rgb(0, 85, 158)
- HSL
- hsl(207.7, 100%, 31%)
- OKLCH
- oklch(44.9% 0.1374 252.73)
- White text 7.51:1 AA pass AAA pass
- Black text 2.79:1 AA fail AAA fail
- RGB
- rgb(57, 130, 209)
- HSL
- hsl(211.2, 62.3%, 52.2%)
- OKLCH
- oklch(59.9% 0.1409 252.78)
- White text 3.97:1 AA fail AAA fail
- Black text 5.28:1 AA pass AAA fail
- RGB
- rgb(110, 178, 255)
- HSL
- hsl(211.9, 100%, 71.6%)
- OKLCH
- oklch(75% 0.1317 252.64)
- White text 2.21:1 AA fail AAA fail
- Black text 9.47:1 AA pass AAA pass
- RGB
- rgb(199, 225, 255)
- HSL
- hsl(212.1, 100%, 89%)
- OKLCH
- oklch(90% 0.0498 252.09)
- White text 1.34:1 AA fail AAA fail
- Black text 15.64:1 AA pass AAA pass
Tints and shades (50 to 900)
Equal steps of OKLCH lightness from light (50) to dark (900) in the base hue. The lightness of your base is closest to step 600.
- RGB
- rgb(238, 246, 255)
- HSL
- hsl(211.8, 100%, 96.7%)
- OKLCH
- oklch(97% 0.0148 251.16)
- White text 1.09:1 AA fail AAA fail
- Black text 19.26:1 AA pass AAA pass
- RGB
- rgb(193, 222, 255)
- HSL
- hsl(211.9, 100%, 87.8%)
- OKLCH
- oklch(89% 0.0551 251.79)
- White text 1.38:1 AA fail AAA fail
- Black text 15.16:1 AA pass AAA pass
- RGB
- rgb(147, 197, 255)
- HSL
- hsl(212.2, 100%, 78.8%)
- OKLCH
- oklch(81% 0.098 252.66)
- White text 1.79:1 AA fail AAA fail
- Black text 11.67:1 AA pass AAA pass
- RGB
- rgb(106, 172, 246)
- HSL
- hsl(211.7, 88.6%, 69%)
- OKLCH
- oklch(73.1% 0.1277 252.42)
- White text 2.37:1 AA fail AAA fail
- Black text 8.84:1 AA pass AAA pass
- RGB
- rgb(74, 146, 225)
- HSL
- hsl(211.4, 71.6%, 58.6%)
- OKLCH
- oklch(65% 0.1391 252.59)
- White text 3.23:1 AA fail AAA fail
- Black text 6.48:1 AA pass AAA fail
- RGB
- rgb(48, 121, 199)
- HSL
- hsl(211, 61.1%, 48.4%)
- OKLCH
- oklch(57% 0.1404 252.84)
- White text 4.48:1 AA fail AAA fail
- Black text 4.68:1 AA pass AAA fail
- RGB
- rgb(31, 98, 166)
- HSL
- hsl(210.2, 68.5%, 38.6%)
- OKLCH
- oklch(49.1% 0.1273 252.41)
- White text 6.25:1 AA pass AAA fail
- Black text 3.35:1 AA fail AAA fail
- RGB
- rgb(23, 75, 130)
- HSL
- hsl(210.8, 69.9%, 30%)
- OKLCH
- oklch(40.9% 0.1069 253.09)
- White text 8.87:1 AA pass AAA pass
- Black text 2.36:1 AA fail AAA fail
- RGB
- rgb(20, 54, 91)
- HSL
- hsl(211.3, 64%, 21.8%)
- OKLCH
- oklch(32.9% 0.0767 252.84)
- White text 12.29:1 AA pass AAA pass
- Black text 1.7:1 AA fail AAA fail
- RGB
- rgb(18, 35, 53)
- HSL
- hsl(210.9, 49.3%, 13.9%)
- OKLCH
- oklch(25.1% 0.0413 251.05)
- White text 15.93:1 AA pass AAA pass
- Black text 1.31:1 AA fail AAA fail
Some colors a hue rotation or a very light or dark step asks for do not exist in sRGB. Those swatches have their chroma reduced (same lightness and hue) until they fit, and are marked "chroma reduced".
Export
CSS custom properties
:root {
--color-base: #1e6bb8;
--color-50: #eef6ff;
--color-100: #c1deff;
--color-200: #93c5ff;
--color-300: #6aacf6;
--color-400: #4a92e1;
--color-500: #3079c7;
--color-600: #1f62a6;
--color-700: #174b82;
--color-800: #14365b;
--color-900: #122335;
--color-complementary-1: #1e6bb8;
--color-complementary-2: #905e00;
--color-analogous-1: #007692;
--color-analogous-2: #1e6bb8;
--color-analogous-3: #605bb8;
--color-triadic-1: #1e6bb8;
--color-triadic-2: #ab4053;
--color-triadic-3: #487a0d;
--color-split-complementary-1: #1e6bb8;
--color-split-complementary-2: #aa4819;
--color-split-complementary-3: #766c00;
--color-square-1: #1e6bb8;
--color-square-2: #9e4380;
--color-square-3: #905e00;
--color-square-4: #007e56;
--color-monochromatic-1: #002e5a;
--color-monochromatic-2: #00559e;
--color-monochromatic-3: #3982d1;
--color-monochromatic-4: #6eb2ff;
--color-monochromatic-5: #c7e1ff;
}Tailwind config
// tailwind.config.js
module.exports = {
theme: {
extend: {
colors: {
palette: {
DEFAULT: '#1e6bb8',
50: '#eef6ff',
100: '#c1deff',
200: '#93c5ff',
300: '#6aacf6',
400: '#4a92e1',
500: '#3079c7',
600: '#1f62a6',
700: '#174b82',
800: '#14365b',
900: '#122335',
},
complementary: {
1: '#1e6bb8',
2: '#905e00',
},
analogous: {
1: '#007692',
2: '#1e6bb8',
3: '#605bb8',
},
triadic: {
1: '#1e6bb8',
2: '#ab4053',
3: '#487a0d',
},
'split-complementary': {
1: '#1e6bb8',
2: '#aa4819',
3: '#766c00',
},
square: {
1: '#1e6bb8',
2: '#9e4380',
3: '#905e00',
4: '#007e56',
},
monochromatic: {
1: '#002e5a',
2: '#00559e',
3: '#3982d1',
4: '#6eb2ff',
5: '#c7e1ff',
},
},
},
},
};JSON
{
"base": "#1e6bb8",
"scale": {
"50": "#eef6ff",
"100": "#c1deff",
"200": "#93c5ff",
"300": "#6aacf6",
"400": "#4a92e1",
"500": "#3079c7",
"600": "#1f62a6",
"700": "#174b82",
"800": "#14365b",
"900": "#122335"
},
"harmonies": {
"complementary": [
"#1e6bb8",
"#905e00"
],
"analogous": [
"#007692",
"#1e6bb8",
"#605bb8"
],
"triadic": [
"#1e6bb8",
"#ab4053",
"#487a0d"
],
"split-complementary": [
"#1e6bb8",
"#aa4819",
"#766c00"
],
"square": [
"#1e6bb8",
"#9e4380",
"#905e00",
"#007e56"
],
"monochromatic": [
"#002e5a",
"#00559e",
"#3982d1",
"#6eb2ff",
"#c7e1ff"
]
}
}Color harmonies and their hue angles
| Harmony | Rule | Colors |
|---|---|---|
| Complementary | 0, +180 degrees | #1e6bb8, #905e00 |
| Analogous | -30, 0, +30 degrees | #007692, #1e6bb8, #605bb8 |
| Triadic | 0, +120, +240 degrees | #1e6bb8, #ab4053, #487a0d |
| Split-complementary | 0, +150, +210 degrees | #1e6bb8, #aa4819, #766c00 |
| Tetradic (square) | 0, +90, +180, +270 degrees | #1e6bb8, #9e4380, #905e00, #007e56 |
| Monochromatic | Lightness 30%, 45%, 60%, 75%, 90% | #002e5a, #00559e, #3982d1, #6eb2ff, #c7e1ff |
The 50 to 900 scale
| Step | Target lightness | Hex | OKLCH | With white | With black |
|---|---|---|---|---|---|
| 50 | 97% | #eef6ff | oklch(97% 0.0148 251.16) | 1.09:1, AA fail | 19.26:1, AA pass |
| 100 | 89% | #c1deff | oklch(89% 0.0551 251.79) | 1.38:1, AA fail | 15.16:1, AA pass |
| 200 | 81% | #93c5ff | oklch(81% 0.098 252.66) | 1.79:1, AA fail | 11.67:1, AA pass |
| 300 | 73% | #6aacf6 | oklch(73.1% 0.1277 252.42) | 2.37:1, AA fail | 8.84:1, AA pass |
| 400 | 65% | #4a92e1 | oklch(65% 0.1391 252.59) | 3.23:1, AA fail | 6.48:1, AA pass |
| 500 | 57% | #3079c7 | oklch(57% 0.1404 252.84) | 4.48:1, AA fail | 4.68:1, AA pass |
| 600 | 49% | #1f62a6 | oklch(49.1% 0.1273 252.41) | 6.25:1, AA pass | 3.35:1, AA fail |
| 700 | 41% | #174b82 | oklch(40.9% 0.1069 253.09) | 8.87:1, AA pass | 2.36:1, AA fail |
| 800 | 33% | #14365b | oklch(32.9% 0.0767 252.84) | 12.29:1, AA pass | 1.7:1, AA fail |
| 900 | 25% | #122335 | oklch(25.1% 0.0413 251.05) | 15.93:1, AA pass | 1.31:1, AA fail |
How to make a color palette from one color
- Enter a base color. Type a color as hex, rgb(), hsl(), hwb() or a name such as rebeccapurple, or use the color picker. The example is #1e6bb8. Press Random base for a new starting point.
- Pick a harmony. Read the complementary, analogous, triadic, split-complementary, square and monochromatic sets. Each swatch is a button: press it to copy its hex code.
- Use the tints and shades scale. The 50 to 900 scale gives you light backgrounds (50, 100) through to dark text and borders (800, 900). For the example, step 600 is #1f62a6, the closest to the base lightness.
- Check the contrast. Each swatch lists the WCAG 2 ratio with white and with black text and whether it passes AA (4.5:1) and AAA (7:1). For example, white text on #3079c7 is 4.48:1.
- Copy the palette. Copy the CSS custom properties for a stylesheet, the Tailwind snippet for tailwind.config.js, or the JSON for a design tool or script.
Frequently asked questions
- What are complementary, analogous, triadic and tetradic colors?
- They are sets of hues at fixed angles on the color wheel. Complementary is the hue opposite the base (180 degrees): #1e6bb8 and #905e00. Analogous colors sit 30 degrees either side (#007692, #1e6bb8, #605bb8). Triadic uses three hues 120 degrees apart (#1e6bb8, #ab4053, #487a0d). Split-complementary uses the two hues next to the complement, at 150 and 210 degrees (#1e6bb8, #aa4819, #766c00). Tetradic (square) uses four hues 90 degrees apart (#1e6bb8, #9e4380, #905e00, #007e56).
- Why use OKLCH instead of HSL for a palette?
- In HSL, colors with the same lightness value can look very different in brightness (yellow looks much lighter than blue at the same L), so steps are uneven. OKLCH is built so that its lightness tracks perceived lightness and a hue rotation changes the hue without changing how light the color looks. That makes the 50 to 900 steps feel evenly spaced and keeps harmony colors balanced.
- What does "chroma reduced" mean on a swatch?
- Some colors a hue rotation or a very light or dark step asks for do not exist in sRGB. Those swatches have their chroma reduced (same lightness and hue) until they fit, and are marked "chroma reduced". The tool does this by lowering chroma and keeping lightness and hue, so the color stays recognizably the same hue and just becomes less saturated. It does not clip channels, which would shift the hue. In the example, 12 of the swatches are marked.
- How is the 50 to 900 scale built?
- Ten steps (50, 100, 200 through 900) are given equal lightness spacing in OKLCH from 97% down to 25%, each with the base hue. Chroma follows a smooth curve: all of the base chroma in the middle, 30% at the two ends, so very light tints are not garish and very dark shades are not muddy. The base is not forced onto a step; the tool tells you which step is closest (step 600 for #1e6bb8).
- Does step 500 match my base color?
- Not necessarily. Some systems pin the base to 500, but this scale uses a fixed lightness ladder so every palette is evenly spaced. The step closest to your base lightness is shown; for #1e6bb8 it is 600. If you want your exact color in the scale, use the base swatch next to it.
- How is the contrast with white and black worked out?
- With the WCAG 2 formula used by the color contrast checker on this site: the ratio of the relative luminances of the two colors, shown to two decimals and cut off, never rounded up. AA needs 4.5:1 for normal text and AAA needs 7:1. For #1e6bb8 that is 5.45:1 with white text and 3.85:1 with black text. This is the contrast of the text color on that swatch as a background.
- How do I use the palette in Tailwind CSS?
- Copy the Tailwind snippet into the theme.extend.colors section of tailwind.config.js. The scale becomes palette-50 to palette-900 (for example bg-palette-100 and text-palette-800), the base is palette, and each harmony is a color group such as triadic-2. Rename the keys to fit your design system.
- What does the Random base button do?
- It picks a hue anywhere on the wheel with a middle lightness and a clear but not extreme chroma, so the result is a usable color rather than a very pale or very dark one. Add ?seed=7 (any whole number) to the page address and the button follows the same sequence every time, which is handy for sharing an example or for testing.
- What happens with a gray or a transparent base?
- A gray has no hue, so rotating the hue gives the same gray every time; the tool says so, and the scale becomes a plain gray ramp. A color with transparency is used as its opaque red, green and blue, and the tool tells you its alpha is ignored.
- Is anything I enter sent anywhere?
- No. The base color is read and the palette is built in your browser, and nothing you type is stored or sent anywhere.
How it works
The base color is read with the same parser as the color converter on this site (hex, rgb(), hsl(), hwb() and the 148 CSS color names) and turned into OKLCH using Björn Ottosson's OKLab matrices as written in CSS Color Module Level 4: linear sRGB to cone responses, a cube root, then a second matrix to L, a and b, with chroma C = sqrt(a squared + b squared) and hue h = atan2(b, a). A harmony adds a fixed angle to the hue and keeps L and C: complementary 180, analogous minus and plus 30, triadic 120 and 240, split-complementary 150 and 210, square 90, 180 and 270. Monochromatic keeps the hue and chroma and sets L to 30%, 45%, 60%, 75%, 90%. The scale sets L in equal steps from 97% (step 50) to 25% (step 900) and scales the base chroma by 0.3 + 0.7 sin(pi t) for t from 0 to 1 across the steps. Each OKLCH color is converted back to sRGB with the inverse matrices. When a result lies outside the sRGB gamut, the tool lowers its chroma by bisection, at the same lightness and hue, until every channel fits, then rounds to 8-bit channels; the swatch is marked "chroma reduced". This is simpler than the full CSS Color 4 gamut-mapping algorithm, which also tolerates a small color difference, so a few colors can end up slightly less saturated than the browser's own mapping would give. The hex, RGB, HSL and OKLCH texts use the color converter's formatting, and the contrast ratios use its WCAG 2 helpers (the same ones as the color contrast checker), compared with 4.5:1 for AA and 7:1 for AAA normal text. A palette depends only on the base color: the random button is the only part that chooses anything, and with a ?seed it is repeatable. Everything runs in your browser and nothing you enter is sent anywhere.
Sources
- CSS Color Module Level 4: OKLab and OKLCH, W3C
- CSS Color Module Level 4: sample code for color conversions, W3C
- CSS Color Module Level 4: gamut mapping, W3C
- A perceptual color space for image processing, Björn Ottosson (OKLab)
- Definition of relative luminance, WCAG 2.2, W3C
- Contrast (minimum), WCAG 2.2 success criterion 1.4.3, W3C
- Tailwind CSS: customizing colors
More free tools
- Color Converter & Contrast CheckerConvert any CSS color between HEX, RGB, HSL, HWB, CMYK and OKLCH, find the nearest named color, and check WCAG 2 contrast for AA and AAA text.
- Color Contrast CheckerCheck the WCAG 2.2 contrast ratio of text on a background, see AA and AAA pass or fail, preview it live, and get the nearest text color that passes.
- CSS Gradient GeneratorBuild linear, radial and conic CSS gradients with up to 8 color stops, preview them live, copy the CSS or a Tailwind class, and check text contrast.
- Image Color PickerPick any pixel of an image for its HEX, RGB, HSL and OKLCH value, and get its dominant colors with contrast. Runs in your browser; nothing is uploaded.
- Unit ConverterConvert length, area, volume, weight and temperature with exact factors, plus cubic yards, tons and bags for gravel, soil, sand and concrete.
- Number Base ConverterConvert whole numbers between binary, octal, decimal, hex and any base from 2 to 36, up to 5,000 digits, with grouped digits and a two’s-complement view.