|
12 | 12 | import math
|
13 | 13 | import re
|
14 | 14 | from colorsys import hls_to_rgb, rgb_to_hls
|
15 |
| -from typing import Any, Callable, Literal, Union, cast |
| 15 | +from typing import Any, Callable, Literal, Tuple, Union, cast |
16 | 16 |
|
17 | 17 | from pydantic import GetJsonSchemaHandler
|
18 | 18 | from pydantic._internal import _repr
|
19 | 19 | from pydantic.json_schema import JsonSchemaValue
|
20 | 20 | from pydantic_core import CoreSchema, PydanticCustomError, core_schema
|
21 | 21 |
|
22 |
| -ColorTuple = Union[tuple[int, int, int], tuple[int, int, int, float]] |
| 22 | +ColorTuple = Union[Tuple[int, int, int], Tuple[int, int, int, float]] |
23 | 23 | ColorType = Union[ColorTuple, str, 'Color']
|
24 |
| -HslColorTuple = Union[tuple[float, float, float], tuple[float, float, float, float]] |
| 24 | +HslColorTuple = Union[Tuple[float, float, float], Tuple[float, float, float, float]] |
25 | 25 |
|
26 | 26 |
|
27 | 27 | class RGBA:
|
@@ -115,7 +115,7 @@ def as_named(self, *, fallback: bool = False) -> str:
|
115 | 115 | """
|
116 | 116 | if self._rgba.alpha is not None:
|
117 | 117 | return self.as_hex()
|
118 |
| - rgb = cast(tuple[int, int, int], self.as_rgb_tuple()) |
| 118 | + rgb = cast('tuple[int, int, int]', self.as_rgb_tuple()) |
119 | 119 |
|
120 | 120 | if rgb in COLORS_BY_VALUE:
|
121 | 121 | return COLORS_BY_VALUE[rgb]
|
|
0 commit comments