Methodology
Named-color dataset
1094 named colors total, from two openly-licensed sources:
- 148 colors from CSS Color Module Level 4 (W3C) extended color keywords — the standard 147 named CSS/X11 colors plus rebeccapurple. Source: https://www.w3.org/TR/css-color-4/#named-colors. License: Open web standard (W3C specification text/keyword-value table) — not a proprietary or trademarked color system. Freely usable as reference data.
- 946 colors from the xkcd color survey (Randall Munroe, 2010) — the canonical published RGB name-to-hex list. Source: https://xkcd.com/color/rgb.txt. License: CC0 (Creative Commons Zero / public domain) — https://creativecommons.org/publicdomain/zero/1.0/
Collision rule: CSS/X11 named colors own the bare slug. An xkcd entry whose slugified name collides with a CSS slug is dropped if its hex is identical to the CSS color, or kept under a `-xkcd` suffixed slug if the hex differs. See docs/BUILD-SPEC.md.
We do not use proprietary/trademarked color systems (e.g. Pantone®, Crayola®) as page content.
Conversion math
Hex, RGB, HSL, HSV, and CMYK use standard, widely-published conversion formulas. Lab uses the CIE 1976 L*a*b* color space via CIE XYZ with a D65 reference white and the sRGB transfer function. OKLCH uses Björn Ottosson's OKLab reference matrices. All math is covered by a unit-tested suite (round-trip + known-value tests) in src/lib/color-core.
Contrast checking
WCAG 2.x relative luminance and contrast-ratio formulas, verified against the documented black-on-white 21:1 maximum and the standard AA (4.5:1 normal / 3:1 large) and AAA (7:1 normal / 4.5:1 large) thresholds.
Color-blindness simulation
Protanopia, deuteranopia, and tritanopia are simulated using the Machado, Oliveira & Fernandes (2009) full-severity dichromacy matrices, a widely-used reference set for browser-based simulators.
Nearest-color matching
Nearest named colors are ranked by CIE76 Delta-E (Euclidean distance in Lab space) — simpler than CIEDE2000 but adequate for relative "which named color is closest" ranking.
Testing and accuracy
All of the math above lives in one shared library, src/lib/color-core, rather than being reimplemented per tool — every converter, the contrast checker, the color-blindness simulator, and every named-color reference page call the same functions. That library is covered by a Vitest unit-test suite checking two kinds of correctness:
- Round-trip tests — converting a value from hex to another space and back should return the original value (within a documented rounding tolerance), across every supported color space.
- Known-value tests — a set of fixed hex values with independently documented conversions (including WCAG's published black-on-white 21:1 maximum contrast ratio) are checked against the library's output directly, so the math is verified against an external reference, not just internal consistency.
This doesn't mean the site is bug-free — it means the core conversion, contrast, and color-blindness math has an automated regression check that runs before any change to the library ships. If you find a value that looks wrong, the contact page reaches the team directly with a specific input and expected output.
Palettes and combinations
"Goes with" color-combination pages compute genuine color-harmony relationships (complementary, analogous, triadic, and related schemes) from a base color using the same color-core library referenced throughout this page. Theme palettes (Sunset Gradient, Ocean Breeze, Forest Canopy, and the rest) are curated to match each theme's real-world intent — a sunset palette is meant to look like an actual sunset, not the output of a generic hue-rotation formula.