Skip to content

Commit 164b7c7

Browse files
Update ipyleaflet/velocity.py
Co-authored-by: David Brochart <[email protected]>
1 parent 21d8895 commit 164b7c7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

ipyleaflet/velocity.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,9 @@ class Velocity(Layer):
7474
def _default_color_scale(self):
7575
self.color_scale = []
7676

77-
for i in range(len(self.colormap.colors)):
78-
rgb_tuple = tuple(str(int(x * 256)) for x in self.colormap.colors[i][:3])
79-
rgb_tuple_str = " , ".join(rgb_tuple)
80-
rgb_str = 'rgb(' + rgb_tuple_str + ')'
77+
for color in self.colormap.colors:
78+
rgb_tuple = tuple(int(x * 256) for x in color[:3])
79+
rgb_str = f'rgb({" , ".join(rgb_tuple)})'
8180
self.color_scale.append(rgb_str)
8281

8382
return self.color_scale

0 commit comments

Comments
 (0)