Skip to content

Colour

Accessibility

Check that a ramp reads in order and survives colour-blindness, and that your classes stand out from the ground.

Check a ramp

kh.check_ramp("viridis")
# {'name': 'viridis', 'kind': 'sequential', 'lightness': 'even', 'colour_blind_safe': True, ...}
  • Lightness: "even" when the steps in perceived lightness are close in size; "not monotonic" when lightness goes up and down, as in turbo and spectral. A sequential map reads best with even, one-way lightness.
  • Colour-blind safe: neighbouring classes stay at least 10 CIE76 units apart when protanopia and deuteranopia are simulated (Machado, 2009).

Both are guides, not guarantees. The ramp gallery marks the safe ramps.

The ground warning

When a class colour almost matches the basemap's ground, so those features would vanish, kharita warns and names the class. Pick a darker ramp or recolour the ground with land-. A diverging scale's neutral middle is exempt, because it is meant to sit close to the ground.

Tips

  • Prefer viridis, cividis, batlow or a single Tailwind family for amounts.
  • Keep categorical maps to about eight classes; the rest are grouped as "other" beyond twelve.
  • Use labels or tooltips so values are readable without colour.