Skip to content

Commit

Permalink
Non-alpha muted backgrounds
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenburns committed Nov 5, 2024
1 parent affbdc1 commit 232ad2e
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/textual/design.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 232ad2e

Please sign in to comment.