From f5c353f87408760dc105c660a30a99aeb70611cb Mon Sep 17 00:00:00 2001 From: Sean Stoops Date: Tue, 19 Nov 2024 11:57:11 -0500 Subject: [PATCH] Fix bug with reference to the deprecated DEFAULT_COLORS global. --- textual_terminal/_terminal.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/textual_terminal/_terminal.py b/textual_terminal/_terminal.py index 4df7816..5418371 100644 --- a/textual_terminal/_terminal.py +++ b/textual_terminal/_terminal.py @@ -31,10 +31,8 @@ from textual.widget import Widget from textual import events -from textual.app import DEFAULT_COLORS from textual import log -from textual.design import ColorSystem class TerminalPyteScreen(pyte.Screen): @@ -370,12 +368,7 @@ def detect_color(self, color: str) -> str: def detect_textual_colors(self) -> dict: """Returns the currently used colors of textual depending on dark-mode.""" - if self.app.dark: - color_system: ColorSystem = DEFAULT_COLORS["dark"] - else: - color_system: ColorSystem = DEFAULT_COLORS["light"] - - return color_system.generate() + return self.app.current_theme.to_color_system().generate() def initial_display(self) -> TerminalDisplay: """Returns the display when initially creating the terminal or clearing it."""