@@ -224,8 +224,8 @@ def _to_rgba_no_colorcycle(c, alpha=None):
224
224
match = re .match (r"\A#[a-fA-F0-9]{6}\Z" , c )
225
225
if match :
226
226
return (tuple (int (n , 16 ) / 255
227
- for n in [c [1 :3 ], c [3 :5 ], c [5 :7 ]])
228
- + (alpha if alpha is not None else 1. ,))
227
+ for n in [c [1 :3 ], c [3 :5 ], c [5 :7 ]]) +
228
+ (alpha if alpha is not None else 1. ,))
229
229
# hex color with alpha.
230
230
match = re .match (r"\A#[a-fA-F0-9]{8}\Z" , c )
231
231
if match :
@@ -836,7 +836,8 @@ def __getitem__(self, item):
836
836
if not isinstance (sss [2 ], complex ):
837
837
sss [2 ] = sss [2 ] / self .N
838
838
if sss [0 ] < 0 or sss [0 ] >= 1 or sss [1 ] <= 0 or sss [1 ] > 1 :
839
- raise IndexError ("Invalid colorbar itemization - outside bounds" )
839
+ raise IndexError ("Invalid colorbar itemization - outside "
840
+ "bounds" )
840
841
points = np .mgrid [slice (* sss )]
841
842
elif isinstance (item , (list , np .ndarray )):
842
843
name = self .name + '[<indexed>]'
@@ -846,12 +847,14 @@ def __getitem__(self, item):
846
847
item = item .astype ('f' ) / self .N
847
848
item [item < 0 ] += 1
848
849
if np .any (item > 1 ):
849
- raise IndexError ("Invalid colorbar itemization - outside bounds" )
850
+ raise IndexError ("Invalid colorbar itemization - outside "
851
+ "bounds" )
850
852
points = item
851
853
else :
852
854
raise IndexError ("Invalid colorbar itemization" )
853
855
if len (points ) <= 1 :
854
- raise IndexError ("Invalid colorbar itemization - a colorbar must contain >1 color." )
856
+ raise IndexError ("Invalid colorbar itemization - a colorbar must "
857
+ "contain >1 color." )
855
858
return ListedColormap (self (points ), name = name )
856
859
857
860
0 commit comments