8000 Change vega10 color package naming convention from: 'vega10:<name>' t… · matplotlib/matplotlib@1d8bf91 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1d8bf91

Browse files
trphamtacaswell
authored andcommitted
Change vega10 color package naming convention from: 'vega10:<name>' to 'vega:<name>'
1 parent 7856091 commit 1d8bf91

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

doc/users/colors.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ it can be provided as:
1717
* a name from the `xkcd color survey <https://xkcd.com/color/rgb/>`__
1818
prefixed with ``'xkcd:'`` (e.g., ``'xkcd:sky blue'``)
1919
* one of ``{'C0', 'C1', 'C2', 'C3', 'C4', 'C5', 'C6', 'C7', 'C8', 'C9'}``
20-
* one of ``{'vega10:blue', 'vega10:orange', 'vega10:green',
21-
'vega10:red', 'vega10:purple', 'vega10:brown', 'vega10:pink',
22-
'vega10:gray', 'vega10:olive', 'vega10:cyan'}``
20+
* one of ``{'vega:blue', 'vega:orange', 'vega:green',
21+
'vega:red', 'vega:purple', 'vega:brown', 'vega:pink',
22+
'vega:gray', 'vega:olive', 'vega:cyan'}``
2323

2424
All string specifications of color are case-insensitive.
2525

lib/matplotlib/_color_data.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
'w': (1, 1, 1)}
1616

1717

18-
VEGA10_COLORS = {
18+
VEGA_COLORS = {
1919
'blue': '#1f77b4',
2020
' 8000 ;orange': '#ff7f0e',
2121
'green': '#2ca02c',
@@ -29,8 +29,7 @@
2929

3030

3131
# Normalize name to "vega10:<name>" to avoid name collisions.
32-
VEGA10_COLORS = {'vega10:' + name: value for name,
33-
value in VEGA10_COLORS.items()}
32+
VEGA_COLORS = {'vega:' + name: value for name, value in VEGA_COLORS.items()}
3433

3534

3635
# This mapping of color names -> hex values is taken from

lib/matplotlib/colors.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
import numpy as np
6767
from numpy import ma
6868
import matplotlib.cbook as cbook
69-
from ._color_data import BASE_COLORS, VEGA10_COLORS, CSS4_COLORS, XKCD_COLORS
69+
from ._color_data import BASE_COLORS, VEGA_COLORS, CSS4_COLORS, XKCD_COLORS
7070

7171

7272
class _ColorMapping(dict):
@@ -87,7 +87,7 @@ def __delitem__(self, key, value):
8787
# Set by reverse priority order.
8888
_colors_full_map.update(XKCD_COLORS)
8989
_colors_full_map.update(CSS4_COLORS)
90-
_colors_full_map.update(VEGA10_COLORS)
90+
_colors_full_map.update(VEGA_COLORS)
9191
_colors_full_map.update(BASE_COLORS)
9292
_colors_full_map = _ColorMapping(_colors_full_map)
9393

@@ -254,8 +254,7 @@ def to_hex(c, keep_alpha=False):
254254
### Backwards-compatible color-conversion API
255255

256256
cnames = CSS4_COLORS
257-
COLOR_NAMES = {'xkcd': XKCD_COLORS, 'css4': CSS4_COLORS,
258-
'vega10': VEGA10_COLORS}
257+
COLOR_NAMES = {'xkcd': XKCD_COLORS, 'css4': CSS4_COLORS, 'vega': VEGA_COLORS}
259258
hexColorPattern = re.compile("\A#[a-fA-F0-9]{6}\Z")
260259

261260

lib/matplotlib/tests/test_colors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ def angled_plane(azimuth, elevation, angle, x, y):
574574
def test_color_names():
575575
assert mcolors.to_hex("blue") == "#0000ff"
576576
assert mcolors.to_hex("xkcd:blue") == "#0343df"
577-
assert mcolors.to_hex("vega10:blue") == "#1f77b4"
577+
assert mcolors.to_hex("vega:blue") == "#1f77b4"
578578

579579

580580
def _sph2cart(theta, phi):

0 commit comments

Comments
 (0)
0