|
25 | 25 | # - Support Methods - |
26 | 26 | # ---------------------------------------------------------------------------------------------------------------------- |
27 | 27 | def _ColorConversionInput(fnc): |
28 | | - def wrapper(self,other): |
| 28 | + def wrapper(self,other:ColorSystem|int|tuple): |
29 | 29 | try: |
30 | | - return fnc(self, color_conversions_mapped[type(self)][type(other)](other),) |
| 30 | + return fnc(self, color_conversions_mapped[type(self)][type(other)](other)) |
31 | 31 | except KeyError: |
32 | 32 | return NotImplemented |
33 | 33 | return wrapper |
@@ -89,50 +89,50 @@ def __divmod__(self, other: tuple) -> tuple: |
89 | 89 | # it will convert the right-hand object to the same type as the left-hand type. |
90 | 90 |
|
91 | 91 | @ _ColorConversionInput |
92 | | - def __add__(self, other: tuple) -> ColorSystem: |
| 92 | + def __add__(self, other: ColorSystem|int|tuple) -> ColorSystem: |
93 | 93 | return self.__class__(*CSD.add(self.export(), other)) |
94 | 94 | @ _ColorConversionInput |
95 | | - def __sub__(self, other: tuple) -> ColorSystem: |
| 95 | + def __sub__(self, other: ColorSystem|int|tuple) -> ColorSystem: |
96 | 96 | return self.__class__(*CSD.sub(self.export(), other)) |
97 | 97 | @ _ColorConversionInput |
98 | | - def __mul__(self, other: tuple) -> ColorSystem: |
| 98 | + def __mul__(self, other: ColorSystem|int|tuple) -> ColorSystem: |
99 | 99 | return self.__class__(*CSD.mul(self.export(), other)) |
100 | 100 | @ _ColorConversionInput |
101 | | - def __floordiv__(self, other: tuple) -> ColorSystem: |
| 101 | + def __floordiv__(self, other: ColorSystem|int|tuple) -> ColorSystem: |
102 | 102 | return self.__class__(*CSD.floordiv(self.export(), other)) |
103 | 103 | @ _ColorConversionInput |
104 | | - def __truediv__(self, other: tuple) -> ColorSystem: |
| 104 | + def __truediv__(self, other: ColorSystem|int|tuple) -> ColorSystem: |
105 | 105 | return self.__class__(*CSD.truediv(self.export(), other)) |
106 | 106 | @ _ColorConversionInput |
107 | | - def __mod__(self, other: tuple) -> ColorSystem: |
| 107 | + def __mod__(self, other: ColorSystem|int|tuple) -> ColorSystem: |
108 | 108 | return self.__class__(*CSD.mod(self.export(), other)) |
109 | 109 | @ _ColorConversionInput |
110 | | - def __pow__(self, other: tuple) -> ColorSystem: |
| 110 | + def __pow__(self, other: ColorSystem|int|tuple) -> ColorSystem: |
111 | 111 | return self.__class__(*CSD.power(self.export(), other)) |
112 | 112 |
|
113 | 113 | @ _ColorConversionInput |
114 | | - def __iadd__(self, other: tuple) -> ColorSystem: |
| 114 | + def __iadd__(self, other: ColorSystem|int|tuple) -> ColorSystem: |
115 | 115 | return self._value_setter(CSD.add(self.export(), other)) |
116 | 116 | @ _ColorConversionInput |
117 | | - def __isub__(self, other: tuple) -> ColorSystem: |
| 117 | + def __isub__(self, other: ColorSystem|int|tuple) -> ColorSystem: |
118 | 118 | return self._value_setter(CSD.sub(self.export(), other)) |
119 | 119 | @ _ColorConversionInput |
120 | | - def __imul__(self, other: tuple) -> ColorSystem: |
| 120 | + def __imul__(self, other: ColorSystem|int|tuple) -> ColorSystem: |
121 | 121 | return self._value_setter(CSD.mul(self.export(), other)) |
122 | 122 | @ _ColorConversionInput |
123 | | - def __ifloordiv__(self, other: tuple) -> ColorSystem: |
| 123 | + def __ifloordiv__(self, other: ColorSystem|int|tuple) -> ColorSystem: |
124 | 124 | return self._value_setter(CSD.floordiv(self.export(), other)) |
125 | 125 | @ _ColorConversionInput |
126 | | - def __itruediv__(self, other: tuple) -> ColorSystem: |
| 126 | + def __itruediv__(self, other: ColorSystem|int|tuple) -> ColorSystem: |
127 | 127 | return self._value_setter(CSD.truediv(self.export(), other)) |
128 | 128 | @ _ColorConversionInput |
129 | | - def __itruediv__(self, other: tuple) -> ColorSystem: |
| 129 | + def __itruediv__(self, other: ColorSystem|int|tuple) -> ColorSystem: |
130 | 130 | return self._value_setter(CSD.truediv(self.export(), other)) |
131 | 131 | @ _ColorConversionInput |
132 | | - def __imod__(self, other: tuple) -> ColorSystem: |
| 132 | + def __imod__(self, other: ColorSystem|int|tuple) -> ColorSystem: |
133 | 133 | return self._value_setter(CSD.mod(self.export(), other)) |
134 | 134 | @ _ColorConversionInput |
135 | | - def __ipow__(self, other: tuple) -> ColorSystem: |
| 135 | + def __ipow__(self, other: ColorSystem|int|tuple) -> ColorSystem: |
136 | 136 | return self._value_setter(CSD.power(self.export(), other)) |
137 | 137 |
|
138 | 138 | # ------------------------------------------------------------------------------------------------------------------ |
@@ -247,25 +247,25 @@ def __divmod__(self, other: tuple) -> tuple: |
247 | 247 | # - Math Dunders - |
248 | 248 | # ------------------------------------------------------------------------------------------------------------------ |
249 | 249 | @ _ColorConversionInput |
250 | | - def __add__(self, other: tuple) -> ColorSystem: |
| 250 | + def __add__(self, other: ColorSystem|int|tuple) -> ColorSystem: |
251 | 251 | return self.__class__(rgb_to_hex(*CSD.add(self.export(), other))) |
252 | 252 | @ _ColorConversionInput |
253 | | - def __sub__(self, other: tuple) -> ColorSystem: |
| 253 | + def __sub__(self, other: ColorSystem|int|tuple) -> ColorSystem: |
254 | 254 | return self.__class__(rgb_to_hex(*CSD.sub(self.export(), other))) |
255 | 255 | @ _ColorConversionInput |
256 | | - def __mul__(self, other: tuple) -> ColorSystem: |
| 256 | + def __mul__(self, other: ColorSystem|int|tuple) -> ColorSystem: |
257 | 257 | return self.__class__(rgb_to_hex(*CSD.mul(self.export(), other))) |
258 | 258 | @ _ColorConversionInput |
259 | | - def __floordiv__(self, other: tuple) -> ColorSystem: |
| 259 | + def __floordiv__(self, other: ColorSystem|int|tuple) -> ColorSystem: |
260 | 260 | return self.__class__(rgb_to_hex(*CSD.floordiv(self.export(), other))) |
261 | 261 | @ _ColorConversionInput |
262 | | - def __truediv__(self, other: tuple) -> ColorSystem: |
| 262 | + def __truediv__(self, other: ColorSystem|int|tuple) -> ColorSystem: |
263 | 263 | return self.__class__(rgb_to_hex(*CSD.truediv(self.export(), other))) |
264 | 264 | @ _ColorConversionInput |
265 | | - def __mod__(self, other: tuple) -> ColorSystem: |
| 265 | + def __mod__(self, other: ColorSystem|int|tuple) -> ColorSystem: |
266 | 266 | return self.__class__(rgb_to_hex(*CSD.mod(self.export(), other))) |
267 | 267 | @ _ColorConversionInput |
268 | | - def __pow__(self, other: tuple) -> ColorSystem: |
| 268 | + def __pow__(self, other: ColorSystem|int|tuple) -> ColorSystem: |
269 | 269 | return self.__class__(rgb_to_hex(*CSD.power(self.export(), other))) |
270 | 270 |
|
271 | 271 | # ------------------------------------------------------------------------------------------------------------------ |
@@ -362,25 +362,25 @@ def __divmod__(self, other: tuple) -> tuple: |
362 | 362 | # - Math Dunders - |
363 | 363 | # ------------------------------------------------------------------------------------------------------------------ |
364 | 364 | @ _ColorConversionInput |
365 | | - def __add__(self, other: tuple) -> ColorSystem: |
| 365 | + def __add__(self, other: ColorSystem|int|tuple) -> ColorSystem: |
366 | 366 | return self.__class__(rgba_to_hexa(*CSD.add(self.export(), other))) |
367 | 367 | @ _ColorConversionInput |
368 | | - def __sub__(self, other: tuple) -> ColorSystem: |
| 368 | + def __sub__(self, other: ColorSystem|int|tuple) -> ColorSystem: |
369 | 369 | return self.__class__(rgba_to_hexa(*CSD.sub(self.export(), other))) |
370 | 370 | @ _ColorConversionInput |
371 | | - def __mul__(self, other: tuple) -> ColorSystem: |
| 371 | + def __mul__(self, other: ColorSystem|int|tuple) -> ColorSystem: |
372 | 372 | return self.__class__(rgba_to_hexa(*CSD.mul(self.export(), other))) |
373 | 373 | @ _ColorConversionInput |
374 | | - def __floordiv__(self, other: tuple) -> ColorSystem: |
| 374 | + def __floordiv__(self, other: ColorSystem|int|tuple) -> ColorSystem: |
375 | 375 | return self.__class__(rgba_to_hexa(*CSD.floordiv(self.export(), other))) |
376 | 376 | @ _ColorConversionInput |
377 | | - def __truediv__(self, other: tuple) -> ColorSystem: |
| 377 | + def __truediv__(self, other: ColorSystem|int|tuple) -> ColorSystem: |
378 | 378 | return self.__class__(rgba_to_hexa(*CSD.truediv(self.export(), other))) |
379 | 379 | @ _ColorConversionInput |
380 | | - def __mod__(self, other: tuple) -> ColorSystem: |
| 380 | + def __mod__(self, other: ColorSystem|int|tuple) -> ColorSystem: |
381 | 381 | return self.__class__(rgba_to_hexa(*CSD.mod(self.export(), other))) |
382 | 382 | @ _ColorConversionInput |
383 | | - def __pow__(self, other: tuple) -> ColorSystem: |
| 383 | + def __pow__(self, other: ColorSystem|int|tuple) -> ColorSystem: |
384 | 384 | return self.__class__(rgba_to_hexa(*CSD.power(self.export(), other))) |
385 | 385 |
|
386 | 386 | # ------------------------------------------------------------------------------------------------------------------ |
|
0 commit comments