10000 ENH: support both spellings of grey an Tableau&xkcd colors · matplotlib/matplotlib@5942a64 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5942a64

Browse files
committed
ENH: support both spellings of grey an Tableau&xkcd colors
1 parent 0d42553 commit 5942a64

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/matplotlib/_color_data.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
'olive': '#bcbd22',
2929
'cyan': '#17becf'}
3030

31-
3231
# Normalize name to "tc:<name>" to avoid name collisions.
3332
TABLEAU_COLORS = {'tc:' + name: value
3433
for name, value in TABLEAU_COLORS.items()}
@@ -992,7 +991,6 @@
992991
'green': '#15b01a',
993992
'purple': '#7e1e9c'}
994993

995-
996994
# Normalize name to "xkcd:<name>" to avoid name collisions.
997995
XKCD_COLORS = {'xkcd:' + name: value for name, value in XKCD_COLORS.items()}
998996

lib/matplotlib/colors.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,14 @@ def __delitem__(self, key, value):
8686
_colors_full_map = {}
8787
# Set by reverse priority order.
8888
_colors_full_map.update(XKCD_COLORS)
89+
_colors_full_map.update({k.replace('grey', 'gray'): v
90+
for k, v in XKCD_COLORS.items()
91+
if 'grey' in k})
8992
_colors_full_map.update(CSS4_COLORS)
9093
_colors_full_map.update(TABLEAU_COLORS)
94+
_colors_full_map.update({k.replace('gray', 'grey'): v
95+
for k, v in TABLEAU_COLORS.items()
96+
if 'gray' in k})
9197
_colors_full_map.update(BASE_COLORS)
9298
_colors_full_map = _ColorMapping(_colors_full_map)
9399

0 commit comments

Comments
 (0)
0