Skip to content

Commit 14e18ba

Browse files
committed
Fix webcolors workaround
1 parent 3805668 commit 14e18ba

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/tikzplotlib/_color.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@
2929
def _get_closest_colour_name(rgb):
3030
match = None
3131
mindiff = 1.0e15
32-
hex_names_dict = webcolors.CSS3_HEX_TO_NAMES if hasattr(webcolors, "CSS3_HEX_TO_NAMES") else webcolors._CSS3_HEX_TO_NAMES
32+
hex_names_dict = (
33+
webcolors.CSS3_HEX_TO_NAMES
34+
if hasattr(webcolors, "CSS3_HEX_TO_NAMES")
35+
else webcolors._definitions._CSS3_HEX_TO_NAMES
36+
)
3337
for h, name in hex_names_dict.items():
3438
r = int(h[1:3], 16)
3539
g = int(h[3:5], 16)

0 commit comments

Comments
 (0)