@@ -241,8 +241,8 @@ def _to_rgba_no_colorcycle(c, alpha=None):
241
241
match = re .match (r"\A#[a-fA-F0-9]{6}\Z" , c )
242
242
if match :
243
243
return (tuple (int (n , 16 ) / 255
244
- for n in [c [1 :3 ], c [3 :5 ], c [5 :7 ]])
245
- + (alpha if alpha is not None else 1. ,))
244
+ for n in [c [1 :3 ], c [3 :5 ], c [5 :7 ]]) +
245
+ (alpha if alpha is not None else 1. ,))
246
246
# hex color with alpha.
247
247
match = re .match (r"\A#[a-fA-F0-9]{8}\Z" , c )
248
248
if match :
@@ -851,7 +851,8 @@ def __getitem__(self, item):
851
851
if not isinstance (sss [2 ], complex ):
852
852
sss [2 ] = sss [2 ] / self .N
853
853
if sss [0 ] < 0 or sss [0 ] >= 1 or sss [1 ] <= 0 or sss [1 ] > 1 :
854
- raise IndexError ("Invalid colorbar itemization - outside bounds" )
854
+ raise IndexError ("Invalid colorbar itemization - outside "
855
+ "bounds" )
855
856
points = np .mgrid [slice (* sss )]
856
857
elif isinstance (item , (list , np .ndarray )):
857
858
name = self .name + '[<indexed>]'
@@ -861,12 +862,14 @@ def __getitem__(self, item):
861
862
item = item .astype ('f' ) / self .N
862
863
item [item < 0 ] += 1
863
864
if np .any (item > 1 ):
864
- raise IndexError ("Invalid colorbar itemization - outside bounds" )
865
+ raise IndexError ("Invalid colorbar itemization - outside "
866
+ "bounds" )
865
867
points = item
866
868
else :
867
869
raise IndexError ("Invalid colorbar itemization" )
868
870
if len (points ) <= 1 :
869
- raise IndexError ("Invalid colorbar itemization - a colorbar must contain >1 color." )
871
+ raise IndexError ("Invalid colorbar itemization - a colorbar must "
872
+ "contain >1 color." )
870
873
return ListedColormap (self (points ), name = name )
871
874
872
875
0 commit comments