Skip to content
Open
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
7 changes: 6 additions & 1 deletion src/cmap/_colormap.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,12 @@ def __call__(
xa[mask_bad] = N + 2

rgba = lut.take(xa, axis=0, mode="clip")
return rgba if np.iterable(x) else Color(rgba)
if np.iterable(x):
return rgba
if bytes:
# Normalize uint8 RGBA back to [0,1] float for Color constructor
return Color(rgba / 255)
return Color(rgba)

def with_extremes(
self,
Expand Down
Loading