Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support int and str input for color values in video module #2400

Merged
merged 9 commits into from
Aug 27, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
20 changes: 16 additions & 4 deletions buildconfig/stubs/pygame/_sdl2/video.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ from pygame.color import Color
from pygame.rect import Rect
from pygame.surface import Surface

from .._common import RectValue, Literal
from .._common import RectValue, ColorValue

WINDOWPOS_UNDEFINED: int
WINDOWPOS_CENTERED: int
Expand Down Expand Up @@ -59,7 +59,12 @@ class Texture:
height: int
alpha: int
blend_mode: int
color: Color

@property
def color(self) -> Color: ...
@color.setter
def color(self, value: ColorValue) -> None: ...

def get_rect(self, **kwargs: Any) -> Rect: ...
def draw(
self,
Expand Down Expand Up @@ -113,12 +118,16 @@ class Image:
origin: Optional[Iterable[float]]
flip_x: bool
flip_y: bool
color: Color
alpha: float
blend_mode: int
texture: Texture
srcrect: Rect

@property
def color(self) -> Color: ...
@color.setter
def color(self, value: ColorValue) -> None: ...

class Renderer:
def __init__(
self,
Expand All @@ -131,7 +140,10 @@ class Renderer:
@classmethod
def from_window(cls, window: Window) -> Renderer: ...
draw_blend_mode: int
draw_color: Color
@property
def draw_color(self) -> Color: ...
dr0id marked this conversation as resolved.
Show resolved Hide resolved
@draw_color.setter
def draw_color(self, value: ColorValue) -> None: ...
def clear(self) -> None: ...
def present(self) -> None: ...
def get_viewport(self) -> Rect: ...
Expand Down
Loading