Skip to content

Commit fb88c07

Browse files
authored
Merge pull request #6269 from Textualize/fix-dim
fix dim
2 parents 6dbad4a + 5218806 commit fb88c07

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1616
- Fixed alt modifier on systems without extended Key Protocol https://github.com/Textualize/textual/pull/6267
1717
- 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
1818
- Fixed exception when setting `loading` attribute before mount https://github.com/Textualize/textual/pull/6268
19+
- Fixed issue with dim filter not using background (may cause snapshot failures) https://github.com/Textualize/textual/pull/6269
1920

2021
## [6.7.1] - 2025-12-1
2122

src/textual/filter.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,17 +248,18 @@ def truecolor_style(self, style: Style, background: RichColor) -> Style:
248248
color.get_truecolor(terminal_theme, foreground=True)
249249
)
250250
changed = True
251-
if style.dim:
252-
color = dim_color(background, color)
253-
style += NO_DIM
254-
changed = True
255251

256252
if (bgcolor := style.bgcolor) is not None and bgcolor.triplet is None:
257253
bgcolor = RichColor.from_triplet(
258254
bgcolor.get_truecolor(terminal_theme, foreground=False)
259255
)
260256
changed = True
261257

258+
if style.dim and color is not None:
259+
color = dim_color(background if bgcolor is None else bgcolor, color)
260+
style += NO_DIM
261+
changed = True
262+
262263
return style + Style.from_color(color, bgcolor) if changed else style
263264

264265
def apply(self, segments: list[Segment], background: Color) -> list[Segment]:

tests/snapshot_tests/__snapshots__/test_snapshots/test_select_expanded.svg

Lines changed: 1 addition & 1 deletion
Loading

tests/snapshot_tests/__snapshots__/test_snapshots/test_select_from_values_expanded.svg

Lines changed: 1 addition & 1 deletion
Loading

tests/snapshot_tests/__snapshots__/test_snapshots/test_select_rebuild.svg

Lines changed: 1 addition & 1 deletion
Loading

0 commit comments

Comments
 (0)