Reference · §19

Color naming

Find the nearest CSS named color by CIEDE2000 distance.

const c = swatch("#c5341c");

c.name();       // { name: "firebrick", hex: "#b22222", deltaE: 8.2 }
c.toName();     // "firebrick"

The lookup table contains all 148 CSS named colors (excluding transparent), deduplicated by hex value (aqua/cyan, grey/gray, magenta/fuchsia map to the same entry).

Lab D65 coordinates are precomputed at module load time so each name() call only converts the query color once.