Skip to content
Merged

fix dim #6269

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Fixed alt modifier on systems without extended Key Protocol https://github.com/Textualize/textual/pull/6267
- Fixed an issue where alpha keys with modifiers weren't lower cased. If you have bound to something like `ctrl+A`, then change to `ctrl+shift+a` https://github.com/Textualize/textual/pull/6267
- Fixed exception when setting `loading` attribute before mount https://github.com/Textualize/textual/pull/6268
- Fixed issue with dim filter not using background (may cause snapshot failures) https://github.com/Textualize/textual/pull/6269

## [6.7.1] - 2025-12-1

Expand Down
9 changes: 5 additions & 4 deletions src/textual/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,17 +248,18 @@ def truecolor_style(self, style: Style, background: RichColor) -> Style:
color.get_truecolor(terminal_theme, foreground=True)
)
changed = True
if style.dim:
color = dim_color(background, color)
style += NO_DIM
changed = True

if (bgcolor := style.bgcolor) is not None and bgcolor.triplet is None:
bgcolor = RichColor.from_triplet(
bgcolor.get_truecolor(terminal_theme, foreground=False)
)
changed = True

if style.dim and color is not None:
color = dim_color(background if bgcolor is None else bgcolor, color)
style += NO_DIM
changed = True

return style + Style.from_color(color, bgcolor) if changed else style

def apply(self, segments: list[Segment], background: Color) -> list[Segment]:
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading