Border colour percentage (#1954)

* Allow setting an additional alpha on a border

See #1863.

* Update the ChangeLog

* Add snapshot tests for the border alpha value

* Extend the border snapshot tests

While this doesn't test *every* permutation, it covers enough bases that if
something were to change it should catch it.

* Tweak a typo in the border style examples

* Add border transparency percentage to the border docs

* Add a CSS example for using border transparency

* Add Color.multiply_alpha

* Update the CHANGELOG

* Multiply the alpha on a colour rather than replace it

As requested in
https://github.com/Textualize/textual/pull/1954#pullrequestreview-1328170386

(actually required while talking in person with Will, but noted in the
above)

* Multiply the alpha on a border colour rather than replace it

As requested in
https://github.com/Textualize/textual/pull/1954#pullrequestreview-1328170386

(actually requested while talking in person with Will, but noted in the
above)
This commit is contained in:
Dave Pearson
2023-03-07 14:14:17 +00:00
committed by GitHub
parent b9977812f7
commit b7de48cca3
7 changed files with 247 additions and 8 deletions

View File

@@ -240,6 +240,11 @@ def test_label_widths(snap_compare):
assert snap_compare(SNAPSHOT_APPS_DIR / "label_widths.py")
def test_border_alpha(snap_compare):
"""Test setting a border alpha."""
assert snap_compare(SNAPSHOT_APPS_DIR / "border_alpha.py")
def test_auto_width_input(snap_compare):
assert snap_compare(
SNAPSHOT_APPS_DIR / "auto_width_input.py", press=["tab", *"Hello"]