Sequential / diverging / categorical palettes
Three palette jobs for charts: one light-to-dark path for amounts, two paths around a midpoint, or distinct colors for unrelated groups.
See it
What it is
These are three different jobs for color in data visualization. A sequential palette moves from light to dark for ordered amounts, such as population density. A diverging palette sends two color paths away from a meaningful center, such as profit and loss around zero. A categorical, or qualitative, palette gives unrelated groups distinct colors without implying that one is larger or better.
Reach for the type that matches the data, not the chart shape. Heatmaps and choropleth maps usually need sequential color; change from a target needs diverging color; product lines or political parties need categorical color. Cartographer Cynthia Brewer's ColorBrewer made this three-way choice a standard part of map and chart work.
Gotcha: a diverging palette needs a center with real meaning. Splitting at the middle of the current data range can invent a story that is not there. Rainbow ramps also scramble perceived order, which is why matplotlib dropped the old jet rainbow for viridis as its default, while categorical palettes become hard to tell apart as groups multiply. Check color vision deficiencies, preserve a steady lightness order for quantities, and add labels or shapes when color would carry the meaning alone.
Ask AI for it
Choose and implement the correct ColorBrewer-style palette for each field in this dataset with D3. Use d3.scaleSequential for ordered magnitudes, d3.scaleDiverging only when the data has a meaningful midpoint such as zero, and d3.scaleOrdinal for unordered categories. Show the domain, midpoint, range, missing-data color, and legend for each scale. Keep sequential lightness monotonic, give the diverging scale a quiet neutral center, test categorical swatches for common color vision deficiencies, and add direct labels wherever color would be the only cue.