mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Create outline for Opacity renderable
This commit is contained in:
19
src/textual/renderables/opacity.py
Normal file
19
src/textual/renderables/opacity.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from rich.console import ConsoleOptions, Console, RenderResult, RenderableType
|
||||
|
||||
|
||||
class Opacity:
|
||||
"""Return a renderable with the foreground color blended into the background color.
|
||||
|
||||
Args:
|
||||
renderable (RenderableType): The RenderableType to manipulate.
|
||||
value (float): The opacity as a float. A value of 1.0 means text is fully visible.
|
||||
"""
|
||||
|
||||
def __init__(self, renderable: RenderableType, value: float = 1.0) -> None:
|
||||
self.renderable = renderable
|
||||
self.value = value
|
||||
|
||||
def __rich_console__(
|
||||
self, console: Console, options: ConsoleOptions
|
||||
) -> RenderResult:
|
||||
pass
|
||||
0
tests/renderables/test_opacity.py
Normal file
0
tests/renderables/test_opacity.py
Normal file
Reference in New Issue
Block a user