diff --git a/docs/source/api.rst b/docs/source/api.rst index 3eae42b..cef76da 100644 --- a/docs/source/api.rst +++ b/docs/source/api.rst @@ -312,9 +312,9 @@ Properties .. attribute:: pixels - List of RGB tuples. + List of row tuples that contain RGB tuples. - :rtype: list[tuple(int, int, int)] + :rtype: list[tuple(tuple(int, int, int), ...)] .. attribute:: pos diff --git a/src/mss/models.py b/src/mss/models.py index a6a7bf8..e756d62 100644 --- a/src/mss/models.py +++ b/src/mss/models.py @@ -8,7 +8,7 @@ Monitors = List[Monitor] Pixel = Tuple[int, int, int] -Pixels = List[Pixel] +Pixels = List[Tuple[Pixel, ...]] CFunctions = Dict[str, Tuple[str, List[Any], Any]] diff --git a/src/mss/screenshot.py b/src/mss/screenshot.py index cad551b..2d5f72a 100644 --- a/src/mss/screenshot.py +++ b/src/mss/screenshot.py @@ -118,7 +118,7 @@ def pixel(self, coord_x: int, coord_y: int) -> Pixel: :return tuple: The pixel value as (R, G, B). """ try: - return self.pixels[coord_y][coord_x] # type: ignore[return-value] + return self.pixels[coord_y][coord_x] except IndexError as exc: msg = f"Pixel location ({coord_x}, {coord_y}) is out of range." raise ScreenShotError(msg) from exc