English | 简体中文
A reference for colour style families — the recognisable looks of a palette, such as macaron, morandi, swiss neutral, nordic, wabi-sabi, memphis and neon.
A palette is not a list of hex codes. A style family is a system: a band of lightness and chroma, a way of organising contrast, and a set of rules about where colour is allowed to appear. Learning the family is what lets you pick colours that belong together — and, more usefully, to recognise when a palette has drifted away from it.
This repository holds the written explanation of each family and the machine-readable palettes behind it.
| Path | What it holds |
|---|---|
docs/ |
The articles — one series per family, each with a definition, a palette walk-through, a comparison and a set of applications |
data/palettes.json |
Every colour value in one file, with its name, role and the band the family lives in |
scripts/palette.mjs |
Colour maths (HSL, OKLCH, WCAG contrast), table generation for the docs, and a documentation linter |
| Family | One line |
|---|---|
| Macaron | Pastel candy colours — high lightness, sweet and approachable |
| Morandi | Grey-toned muted colours — nothing shouts |
| Swiss neutral | Near-monochrome with exactly one signal colour |
| Nordic | Cool, pale and airy, warmed by a few accents |
| Wabi-sabi | Earth-derived colours with visible texture |
| Memphis | High-chroma primaries and hot pink — loud on purpose |
| Neon | A near-black canvas lit by fluorescent accents |
Start with What is a colour family if you are new to the idea, or Family at a glance if you want to choose one.
The palettes are plain JSON — copy what you need:
{
"id": "strawberry-milk",
"name": { "en": "Strawberry Milk", "cn": "草莓牛奶" },
"hex": "#F8C8DC",
"role": "base"
}To check the numbers behind a palette — lightness, chroma, contrast against white and black:
node scripts/palette.mjs statsTo regenerate the tables embedded in the docs after editing data/palettes.json:
node scripts/palette.mjs tablesTo lint the documentation (missing pages, broken links, colours that do not exist in the palette, out-of-date tables):
node scripts/palette.mjs checkThe book is published as its own Cloudflare Worker:
- English: https://x-cmd.com/color/
- 中文: https://www.x-cmd.com/color/cn/
Every article page carries a language toggle. The same interface rendered in all seven families' colours is on the home page — buttons, tags, stat cards, chart bars and alerts, generated from each family's own palette.
To rebuild the static site after editing docs/ or data/palettes.json:
npm install
npm run build:site # docs + palettes -> dist/color/To deploy (requires Cloudflare auth for the x-cmd account):
npm run deploy # build + wrangler deploy (assets-only worker, routes x-cmd.com/color*)| Topic | English | 中文 |
|---|---|---|
| What is a colour family | en | cn |
| Reading a palette | en | cn |
| Family at a glance | en | cn |
Every article exists in English and Chinese; the two versions mirror each other section for section.
Apache-2.0 — see LICENSE.