mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
20 lines
469 B
Python
20 lines
469 B
Python
from textual.app import App, ComposeResult
|
|
from textual.widgets import Static
|
|
|
|
|
|
class PrideApp(App):
|
|
"""Displays a pride flag."""
|
|
|
|
COLORS = ["red", "orange", "yellow", "green", "blue", "purple"]
|
|
|
|
def compose(self) -> ComposeResult:
|
|
for color in self.COLORS:
|
|
stripe = Static()
|
|
stripe.styles.height = "1fr"
|
|
stripe.styles.background = color
|
|
yield stripe
|
|
|
|
|
|
if __name__ == "__main__":
|
|
PrideApp().run()
|