From 232ad2e7fde161387d4b8c3505cfdede4386a9b4 Mon Sep 17 00:00:00 2001 From: Darren Burns Date: Tue, 5 Nov 2024 14:05:41 +0000 Subject: [PATCH] Non-alpha muted backgrounds --- src/textual/design.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/textual/design.py b/src/textual/design.py index ace2ecf13d..8abf723d53 100644 --- a/src/textual/design.py +++ b/src/textual/design.py @@ -212,14 +212,20 @@ def luminosity_range(spread: float) -> Iterable[tuple[str, float]]: colors["text-disabled"] = "ansi_default" # Muted variants of base colors - colors["primary-muted"] = get("primary-muted", primary.with_alpha(0.3).hex) + colors["primary-muted"] = get( + "primary-muted", primary.blend(background, 0.7).hex + ) colors["secondary-muted"] = get( - "secondary-muted", secondary.with_alpha(0.3).hex + "secondary-muted", secondary.blend(background, 0.7).hex + ) + colors["accent-muted"] = get("accent-muted", accent.blend(background, 0.7).hex) + colors["warning-muted"] = get( + "warning-muted", warning.blend(background, 0.7).hex + ) + colors["error-muted"] = get("error-muted", error.blend(background, 0.7).hex) + colors["success-muted"] = get( + "success-muted", success.blend(background, 0.7).hex ) - colors["accent-muted"] = get("accent-muted", accent.with_alpha(0.3).hex) - colors["warning-muted"] = get("warning-muted", warning.with_alpha(0.3).hex) - colors["error-muted"] = get("error-muted", error.with_alpha(0.3).hex) - colors["success-muted"] = get("success-muted", success.with_alpha(0.3).hex) # Foreground colors colors["foreground-muted"] = get(