Skip to content

Commit 9f38c1d

Browse files
committed
Compat with webcolors v24.6.0
Work around ubernostrum/webcolors@68ba427 / ubernostrum/webcolors#20
1 parent 450712b commit 9f38c1d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/tikzplotlib/_color.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
def _get_closest_colour_name(rgb):
3030
match = None
3131
mindiff = 1.0e15
32-
for h, name in webcolors.CSS3_HEX_TO_NAMES.items():
32+
hex_names_dict = webcolors.CSS3_HEX_TO_NAMES if hasattr(webcolors, "CSS3_HEX_TO_NAMES") else webcolors._CSS3_HEX_TO_NAMES
33+
for h, name in hex_names_dict.items():
3334
r = int(h[1:3], 16)
3435
g = int(h[3:5], 16)
3536
b = int(h[5:7], 16)

0 commit comments

Comments
 (0)