Skip to content

Commit dca0179

Browse files
committed
expose enabled to constructor
1 parent 6ec3247 commit dca0179

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/textual/filter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,14 +177,14 @@ def dim_style(style: Style, background: Color, factor: float) -> Style:
177177
class DimFilter(LineFilter):
178178
"""Replace dim attributes with modified colors."""
179179

180-
def __init__(self, dim_factor: float = 0.5) -> None:
180+
def __init__(self, dim_factor: float = 0.5, enabled: bool = True) -> None:
181181
"""Initialize the filter.
182182
183183
Args:
184184
dim_factor: The factor to dim by; 0 is 100% background (i.e. invisible), 1.0 is no change.
185185
"""
186186
self.dim_factor = dim_factor
187-
super().__init__()
187+
super().__init__(enabled=enabled)
188188

189189
def apply(self, segments: list[Segment], background: Color) -> list[Segment]:
190190
"""Transform a list of segments.

0 commit comments

Comments
 (0)