mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Added tint and opacity
This commit is contained in:
@@ -140,8 +140,8 @@ class Size(NamedTuple):
|
||||
return Region(0, 0, width, height)
|
||||
|
||||
@property
|
||||
def lines(self) -> list[int]:
|
||||
return list(range(self.height))
|
||||
def lines_range(self) -> range:
|
||||
return range(self.height)
|
||||
|
||||
def __add__(self, other: object) -> Size:
|
||||
if isinstance(other, tuple):
|
||||
@@ -310,21 +310,21 @@ class Region(NamedTuple):
|
||||
return bool(self.width and self.height)
|
||||
|
||||
@property
|
||||
def x_extents(self) -> tuple[int, int]:
|
||||
"""Get the starting and ending x coord.
|
||||
def column_span(self) -> tuple[int, int]:
|
||||
"""Get the start and end column (x coord).
|
||||
|
||||
The end value is non inclusive.
|
||||
The end value is exclusive.
|
||||
|
||||
Returns:
|
||||
tuple[int, int]: Pair of x coordinates (row numbers).
|
||||
tuple[int, int]: Pair of x coordinates (column numbers).
|
||||
"""
|
||||
return (self.x, self.x + self.width)
|
||||
|
||||
@property
|
||||
def y_extents(self) -> tuple[int, int]:
|
||||
"""Get the starting and ending x coord.
|
||||
def line_span(self) -> tuple[int, int]:
|
||||
"""Get the star and end line number (y coord).
|
||||
|
||||
The end value is non inclusive.
|
||||
The end value is exclusive.
|
||||
|
||||
Returns:
|
||||
tuple[int, int]: Pair of y coordinates (line numbers).
|
||||
@@ -385,12 +385,12 @@ class Region(NamedTuple):
|
||||
return x, y, x + width, y + height
|
||||
|
||||
@property
|
||||
def x_range(self) -> range:
|
||||
def column_range(self) -> range:
|
||||
"""A range object for X coordinates."""
|
||||
return range(self.x, self.x + self.width)
|
||||
|
||||
@property
|
||||
def y_range(self) -> range:
|
||||
def line_range(self) -> range:
|
||||
"""A range object for Y coordinates."""
|
||||
return range(self.y, self.y + self.height)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user