File size: 411 Bytes
5b76e0f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from textual.app import App
from textual.color import Color
from textual.widgets import Static


class TintApp(App):
    def compose(self):
        color = Color.parse("green")
        for tint_alpha in range(0, 101, 10):
            widget = Static(f"tint: green {tint_alpha}%;")
            widget.styles.tint = color.with_alpha(tint_alpha / 100)
            yield widget


app = TintApp(css_path="tint.css")