Skip to content

Commit 599f86c

Browse files
Andon-LiBoboTiG
andauthored
fix: Pixels model correction (#274)
* Changed Pixels model and updated documentation. * Update screenshot.py --------- Co-authored-by: Mickaël Schoentgen <[email protected]>
1 parent 20a24c5 commit 599f86c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

docs/source/api.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,9 @@ Properties
312312

313313
.. attribute:: pixels
314314

315-
List of RGB tuples.
315+
List of row tuples that contain RGB tuples.
316316

317-
:rtype: list[tuple(int, int, int)]
317+
:rtype: list[tuple(tuple(int, int, int), ...)]
318318

319319
.. attribute:: pos
320320

src/mss/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
Monitors = List[Monitor]
99

1010
Pixel = Tuple[int, int, int]
11-
Pixels = List[Pixel]
11+
Pixels = List[Tuple[Pixel, ...]]
1212

1313
CFunctions = Dict[str, Tuple[str, List[Any], Any]]
1414

src/mss/screenshot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def pixel(self, coord_x: int, coord_y: int) -> Pixel:
118118
:return tuple: The pixel value as (R, G, B).
119119
"""
120120
try:
121-
return self.pixels[coord_y][coord_x] # type: ignore[return-value]
121+
return self.pixels[coord_y][coord_x]
122122
except IndexError as exc:
123123
msg = f"Pixel location ({coord_x}, {coord_y}) is out of range."
124124
raise ScreenShotError(msg) from exc

0 commit comments

Comments
 (0)