Skip to content

Offer a diverging colormap - #20

Merged
CSSFrancis merged 2 commits into
mainfrom
fix/diverging-colormap
Oct 22, 2026
Merged

CSSFrancis merged 2 commits into
mainfrom
fix/diverging-colormap

Conversation

@CSSFrancis

Copy link
Copy Markdown
Member

The picker's CET_R1 was commented as diverging, but it is colorcet's rainbow: its middle entry is yellow (241, 202, 36). So there was no map on the list that shows a signed image (a strain, a field component) with zero as white.

  • Adds CET_D1 (blue → white → red, the same table as matplotlib's coolwarm) to COLORMAPS, and keeps CET_R1, relabeled, since someone may be using it.
  • Adds DIVERGING_COLORMAP = "CET_D1", for apps that switch to it on their own. Autopilot's strain maps do this.
  • Tests: every listed name renders its own color table (a misspelled name falls back silently to gray), and the diverging map is white in the middle, blue below and red above.

CET_R1 is colorcet's rainbow (its middle is yellow), so the picker had no map
for a signed image. Add CET_D1, blue-white-red (matplotlib's coolwarm), and
name it DIVERGING_COLORMAP for apps that show strains or field components.
@CSSFrancis
CSSFrancis merged commit ab04164 into main Oct 22, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant