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

Skip to content

Commit e559ace

Browse files
committed
Explicite cast to int in colors
1 parent 4d3b23a commit e559ace

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/matplotlib/colors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def is_color_like(c):
222222

223223
def rgb2hex(rgb):
224224
'Given an rgb or rgba sequence of 0-1 floats, return the hex string'
225-
return '#%02x%02x%02x' % tuple([np.round(val * 255) for val in rgb[:3]])
225+
return '#%02x%02x%02x' % tuple([int(np.round(val * 255)) for val in rgb[:3]])
226226

227227
hexColorPattern = re.compile("\A#[a-fA-F0-9]{6}\Z")
228228

0 commit comments

Comments
 (0)