Files
textual/docs/examples/actions/colorizer.py
Will McGugan 611f089d9c readme
2021-08-14 17:07:12 +01:00

15 lines
332 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')")
async def action_color(self, color: str) -> None:
self.background = f"on {color}"
Colorizer.run()