Colors and Colormaps

This page covers practical usage: picking colors, mixing them, interpolating gradients, and using colormaps. For full visual catalogs, jump to the Colors, Palettes, or Colormaps catalogs under Design System.

Named colors

dartwork-mpl ships its own curated palette — dc.* (“dartwork color”) — and registers six third-party design systems alongside it for cross-team consistency. Use any of them anywhere matplotlib accepts a color.

Prefix

Library

Example

dc.*

dartwork Color (recommended) — 20 families × 10 perceptual steps, plus Octave as dc.octave; see the palette catalog

dc.teal3

oc.*

OpenColor

oc.blue5

tw.*

Tailwind CSS

tw.blue500

md.*

Material Design

md.red500

ad.*

Ant Design

ad.blue6

cu.*

Chakra UI

cu.teal500

pr.*

Primer (GitHub)

pr.blue5

Start with dc.* for new figures — the palettes are tuned for publication-ready output. Reach for the third-party prefixes when you need to match an external brand or design system.

The dc.* namespace also holds 43 continuous colormaps plus the two Octave cycle colormaps — see the Colormap catalog. Colormap names like dc.aurora only work as cmap= arguments, not as color= strings; the named-colors above are the ones you pass to color=.

import matplotlib.pyplot as plt
import dartwork_mpl as dm

dm.style.use("presentation")

fig, ax = plt.subplots(figsize=dm.figsize("8cm", "wide"))
ax.plot([0, 1, 2], [1, 2, 1.5], marker="o", color="dc.green2", label="dc.green2")
ax.plot([0, 1, 2], [1.2, 1.6, 2.1], marker="s", color="dc.teal3", label="dc.teal3")
highlight = dm.mix_colors("dc.orange1", "white", alpha=0.45)
ax.fill_between([0, 1, 2], 0.9, 1.3, color=highlight, label="Mixed shade")
muted_line = dm.pseudo_alpha("dc.violet3", alpha=0.65, background="white")
ax.plot([0, 1, 2], [0.8, 1.1, 1.4], color=muted_line, label="Pseudo alpha")
ax.legend()
dm.simple_layout(fig)

To choose a series palette visually, use the Palettes explorer. It previews Octave, curated qualitative sets, family samples, B&W/CVD checks, and copyable dm.set_colors(...) / dm.colors(..., n=...) calls.

Once you’ve picked a set, apply it in your own script:

import matplotlib as mpl
from cycler import cycler

dm.style.use("report")  # base preset (font, line widths, spines, ...)
mpl.rcParams["axes.prop_cycle"] = cycler(color=[
    "dc.teal3", "dc.teal1", "dc.teal5",
    "dc.teal0", "dc.teal2", "dc.teal4",
])

Picking a dc.* swatch

The dc.* surface is 19 chromatic hue families plus gray, each with 10 perceptually equalized steps. Index 0 is the light end and index 9 is the dark end. For unrelated categories use Octave via dm.set_colors() or dc.octave; for related tones pick a family and sample the steps you need.

Palette

Use it for

dc.octave

Octave, for everyday unrelated categories

dc.blue / dc.teal / dc.indigo

Cool analytical series and ordered data

dc.green / dc.red

Positive/negative states and status colors

dc.coral / dc.tangerine / dc.orange / dc.amber

Warm emphasis, thresholds, and call-outs

dc.cobalt / dc.violet / dc.purple / dc.fuchsia / dc.pink

Editorial accents and qualitative groups

dc.gray

Grid lines, baselines, secondary fills

dc.blue_red / dc.teal_amber

Diverging ± data — change, correlation

dc.hl

Semantic highlight token

→ The full token catalog lives on Colors; the series explorer lives on Palettes.

Coming from oc.*? A rough drop-in mapping:

If you were reaching for…

Try…

oc.blue6 / oc.indigo6 / oc.cyan6

dc.teal3

oc.red6 / oc.pink6

dc.red5 or dc.rose5

oc.orange5 / oc.yellow5

dc.orange1 / dc.orange0

oc.green6 / oc.teal6 / oc.lime6

dc.green2 or dc.red0

oc.violet6 / oc.grape6

dc.violet3

oc.gray3..7 (light → dark)

dc.gray2..7

Color class

For most plots, named color strings like "dc.teal3" are all you need. When you need to programmatically adjust hue, saturation, or lightness — or interpolate between colors in a perceptually uniform space — use the Color class:

import dartwork_mpl as dm

color = dm.oklch(0.7, 0.15, 150)    # OKLCH (L, C, h°)
color.oklch.C *= 1.2                 # boost chroma in-place
print(color.to_hex())                # '#...'

Full guide: Color class & manipulation — constructors, views, interpolation, and custom colormaps.

Exploring Available Colors

dartwork-mpl provides utilities to discover and explore available color families:

import dartwork_mpl as dm

# List Model B family records
families = dm.list_colors()
print(families[:2])  # [{'name': 'amber', 'kind': 'sequential', ...}, ...]

# Fetch a registered colormap or a designed discrete list
cmap = dm.colors("aurora")
cols = dm.colors("blue_red", n=5)

# Preview specific families
dm.show_colors(names=["blue", "blue_red"], n=5)

# Classify a colormap by type (takes a Colormap object)
import matplotlib as mpl
from dartwork_mpl.diagnostics import classify_cmap

cmap_type = classify_cmap(mpl.colormaps['dc.aurora'])
print(cmap_type)  # 'Multi-Hue'

Color interpolation

import dartwork_mpl as dm

# Perceptual interpolation between colors (OKLCH by default)
palette = dm.cspace('#FF6B6B', '#4ECDC4', n=5, space='oklch')
for i, c in enumerate(palette):
    ax.bar(i, 1, color=c.to_hex())

# Also supports 'oklab' and 'rgb' spaces
gradient = dm.cspace(dm.color('dc.red1'), dm.color('dc.teal3'), n=10)
From
To
Steps n=5
dm.cspace('#FF6B6B', '#4ECDC4', n=5, space='oklch')

Why OKLCH matters: Interpolating in RGB produces muddy, desaturated midtones. OKLCH maintains perceptual uniformity — every step looks equally spaced to the human eye:

OKLCH vs RGB Interpolation
Why color space matters for gradient quality
Steps n=20
OKLCHperceptually uniform
RGBmuddy midtones
OKLCH maintains vivid hues through the transition. ↓ RGB produces muddy, desaturated midtones — notice the grey-brown colors in the middle.

Colormaps

dartwork-mpl bundles custom colormaps prefixed with dc. — curated for perceptually uniform gradients. They work like any matplotlib colormap:

import matplotlib.pyplot as plt
import dartwork_mpl as dm
from dartwork_mpl.diagnostics import classify_cmap

cmap = plt.colormaps["dc.aurora"]
print(cmap.name)                       # 'dc.aurora'
print(classify_cmap(cmap))             # 'Multi-Hue' (tells you the type)

Add _r to reverse any colormap (e.g., dc.aurora_r). Browse all available colormaps on the Colormaps page.

See also