[F] Fix unhashable type error for RGB
This commit is contained in:
parent
0960024e71
commit
cd4849f0b8
1 changed files with 2 additions and 2 deletions
|
|
@ -83,7 +83,7 @@ def redistribute_rgb(r: int, g: int, b: int) -> tuple[int, int, int]:
|
||||||
return int(gray + x * r), int(gray + x * g), int(gray + x * b)
|
return int(gray + x * r), int(gray + x * g), int(gray + x * b)
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass(unsafe_hash=True)
|
||||||
class HSL:
|
class HSL:
|
||||||
h: float
|
h: float
|
||||||
s: float
|
s: float
|
||||||
|
|
@ -96,7 +96,7 @@ class HSL:
|
||||||
return RGB(*[round(v * 255.0) for v in colorsys.hls_to_rgb(self.h, self.l, self.s)])
|
return RGB(*[round(v * 255.0) for v in colorsys.hls_to_rgb(self.h, self.l, self.s)])
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass(unsafe_hash=True)
|
||||||
class RGB:
|
class RGB:
|
||||||
r: int
|
r: int
|
||||||
g: int
|
g: int
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue