Files
textual/docs/examples/actions/colorizer.py
Will McGugan 577ef6bd25 version bump
2021-08-25 20:20:51 +01:00

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()