mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Update tint reference.
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
# Tint
|
||||
|
||||
The tint rule blends a color with the widget. The color should likely have an _alpha_ component, or the end result would obscure the widget content.
|
||||
The `tint` rule blends a color with the whole widget.
|
||||
|
||||
## Syntax
|
||||
|
||||
```
|
||||
tint: <COLOR> [<PERCENTAGE>];
|
||||
```
|
||||
--8<-- "docs/snippets/syntax_block_start.md"
|
||||
tint: <a href="../../css_types/color"><color></a> [<a href="../../css_types/percentage"><percentage></a>];
|
||||
--8<-- "docs/snippets/syntax_block_end.md"
|
||||
|
||||
The tint rule blends a [`<color>`](../css_types/color.md) with the widget. The color should likely have an _alpha_ component (specified directly in the color used or by the optional [`<percentage>`](../css_types/percentage.md)), otherwise the end result will obscure the widget content.
|
||||
|
||||
## Example
|
||||
|
||||
@@ -47,5 +49,5 @@ from textual.color import Color
|
||||
widget.styles.tint = Color.parse("red").with_alpha(0.2);
|
||||
|
||||
# A green tint
|
||||
widget.styles.tint = "rgba(0, 200, 0, 0.3):
|
||||
widget.styles.tint = "rgba(0, 200, 0, 0.3)"
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user