File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -3220,11 +3220,9 @@ def _unconvert_from_RGB_255(colors):
3220
3220
a value between 0 and 1
3221
3221
3222
3222
"""
3223
- un_rgb_color = (colors [0 ]/ (255.0 ),
3224
- colors [1 ]/ (255.0 ),
3225
- colors [2 ]/ (255.0 ))
3226
-
3227
- return un_rgb_color
3223
+ return (colors [0 ]/ (255.0 ),
3224
+ colors [1 ]/ (255.0 ),
3225
+ colors [2 ]/ (255.0 ))
3228
3226
3229
3227
@staticmethod
3230
3228
def _map_face2color (face , colormap , vmin , vmax ):
@@ -4562,12 +4560,15 @@ def _endpts_to_intervals(endpts):
4562
4560
@staticmethod
4563
4561
def _convert_to_RGB_255 (colors ):
4564
4562
"""
4565
- Multiplies each element of a triplet by 255 and rounds to floor int
4563
+ Multiplies each element of a triplet by 255
4564
+
4565
+ Each coordinate of the color tuple is rounded to the nearest float and
4566
+ then is turned into an integer
4566
4567
"""
4567
4568
4568
- return (int (colors [0 ]* 255.0 ),
4569
- int (colors [1 ]* 255.0 ),
4570
- int (colors [2 ]* 255.0 ))
4569
+ return (round ( int (colors [0 ]* 255.0 ) ),
4570
+ round ( int (colors [1 ]* 255.0 ) ),
4571
+ round ( int (colors [2 ]* 255.0 ) ))
4571
4572
4572
4573
@staticmethod
4573
4574
def _n_colors (lowcolor , highcolor , n_colors ):
You can’t perform that action at this time.
0 commit comments