Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9687f65

Browse files
committed
TST: add smoke test for the color blue
1 parent fafa36f commit 9687f65

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/matplotlib/tests/test_colors.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,15 @@ def angled_plane(azimuth, elevation, angle, x, y):
521521
assert_array_almost_equal(h, np.cos(np.radians(angle)))
522522

523523

524+
def test_xkcd():
525+
x11_blue = mcolors.rgb2hex(
526+
mcolors.colorConverter.to_rgb('blue'))
527+
assert x11_blue == '#0000ff'
528+
XKCD_blue = mcolors.rgb2hex(
529+
mcolors.colorConverter.to_rgb('XKCDblue'))
530+
assert XKCD_blue == '#0343df'
531+
532+
524533
def _sph2cart(theta, phi):
525534
x = np.cos(theta) * np.sin(phi)
526535
y = np.sin(theta) * np.sin(phi)

0 commit comments

Comments
 (0)