mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
15 lines
326 B
Python
15 lines
326 B
Python
from textual.app import App
|
|
|
|
|
|
class Colorizer(App):
|
|
async def on_load(self):
|
|
await self.bind("r", "color('red')")
|
|
await self.bind("g", "color('green')")
|
|
await self.bind("b", "color('blue')")
|
|
|
|
def action_color(self, color: str) -> None:
|
|
self.background = f"on {color}"
|
|
|
|
|
|
Colorizer.run()
|