Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/cmap/_color.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
RGBTuple, # 3-tuple of all ints or all floats
RGBATuple, # 4-tuple of all floats, or 3 ints and 1 float
np.ndarray, # 3- or 4-element rgb(a) vector
np.number,
list[Union[float, int]], # 3- or 4-element rgb(a) vector
"Color", # another color object
]
Expand Down
2 changes: 1 addition & 1 deletion src/cmap/_colormap.py
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,7 @@ def to_css(
If `True`, return colors as hex strings, by default use `rgba()` strings.
"""
if max_stops and len(self._stops) > max_stops:
stops = tuple(np.linspace(0, 1, max_stops))
stops: tuple[np.floating, ...] = tuple(np.linspace(0, 1, max_stops))
colors = tuple(Color(c) for c in self.to_lut(max_stops))
else:
stops, colors = self.stops, self.colors
Expand Down