Annotate PIL.ImageColor (#6151)

This commit is contained in:
Nikita Sobolev
2021-10-11 19:20:02 +03:00
committed by GitHub
parent 023c4dff67
commit 2eadf9c174
2 changed files with 9 additions and 5 deletions

View File

@@ -1,6 +1,10 @@
from typing import Any
from typing import Tuple, Union
def getrgb(color): ...
def getcolor(color, mode): ...
_RGB = Union[Tuple[int, int, int], Tuple[int, int, int, int]]
_Ink = Union[str, int, _RGB]
_GreyScale = Tuple[int, int]
colormap: Any
def getrgb(color: _Ink) -> _RGB: ...
def getcolor(color: _Ink, mode: str) -> _RGB | _GreyScale: ...
colormap: dict[str, str]

View File

@@ -3,9 +3,9 @@ from typing import Any, Sequence, Tuple, Union, overload
from typing_extensions import Literal
from .Image import Image
from .ImageColor import _Ink
from .ImageFont import _Font
_Ink = Union[str, int, Tuple[int, int, int], Tuple[int, int, int, int]]
_XY = Sequence[Union[float, Tuple[float, float]]]
_Outline = Any