@@ -121,6 +121,9 @@ class Colormap:
121121 """
122122
123123 __slots__ = (
124+ "__weakref__" ,
125+ "_initialized" ,
126+ "_lut_cache" ,
124127 "bad_color" ,
125128 "category" ,
126129 "color_stops" ,
@@ -130,9 +133,6 @@ class Colormap:
130133 "name" ,
131134 "over_color" ,
132135 "under_color" ,
133- "_initialized" ,
134- "_lut_cache" ,
135- "__weakref__" ,
136136 )
137137
138138 color_stops : ColorStops
@@ -920,7 +920,7 @@ def _from_colorarray_like(cls, colors: ArrayLike) -> ColorStops:
920920 return cls (np .concatenate ([stops [:, None ], ary ], axis = 1 ))
921921
922922 @property
923- def stops (self ) -> tuple [float , ...]:
923+ def stops (self ) -> tuple [np . floating , ...]:
924924 """Return tuple of color stop positions."""
925925 return tuple (self ._stops [:, 0 ])
926926
@@ -1061,14 +1061,14 @@ def to_css(
10611061 midpoints = np .linspace (0 , 1 , len (colors ) + 1 )[1 :- 1 ]
10621062 _midstops = []
10631063 for m , (c1 , c2 ) in zip (midpoints , zip (colors [:- 1 ], colors [1 :])):
1064- s1 = f"{ c1 .hex if as_hex else c1 .rgba_string } { m * 100 :g} %"
1065- s2 = f"{ c2 .hex if as_hex else c2 .rgba_string } { m * 100 :g} %"
1064+ s1 = f"{ c1 .hex if as_hex else c1 .rgba_string } { m * 100 :g} %"
1065+ s2 = f"{ c2 .hex if as_hex else c2 .rgba_string } { m * 100 :g} %"
10661066 _midstops .extend ([s1 , s2 ])
10671067 _stops = ", " .join (_midstops )
10681068 else :
10691069 _stops = ", " .join (
10701070 [
1071- f"{ c .hex if as_hex else c .rgba_string } { s * 100 :g} %"
1071+ f"{ c .hex if as_hex else c .rgba_string } { s * 100 :g} %"
10721072 for c , s in zip (colors , stops )
10731073 ]
10741074 )
0 commit comments