From: Armaan Bhojwani Date: Sat, 13 Feb 2021 18:00:46 +0000 (-0500) Subject: Implement color customization config option X-Git-Tag: v0.7.0~31 X-Git-Url: https://git.armaanb.net/?p=lightcards.git;a=commitdiff_plain;h=fc06161aeda6cfe95495c6c52d63c56c4942f889 Implement color customization config option --- diff --git a/config.py b/config.py index e12faa3..32b75ef 100644 --- a/config.py +++ b/config.py @@ -1,6 +1,7 @@ ############################################################################### # LIGHTCARDS DEFAULT CONFIG FILE # ############################################################################### +import curses ############################################################################### # STARTUP OPTIONS @@ -17,8 +18,9 @@ default_view = 1 progress_char = "»" -highlight_color = "green" -starred_color = "yellow" +highlight_color = curses.COLOR_CYAN +starred_color = curses.COLOR_YELLOW +error_color = curses.COLOR_RED ############################################################################### # KEYBINDINGS diff --git a/lightcards/display.py b/lightcards/display.py index f5f5f6c..8e19d3c 100644 --- a/lightcards/display.py +++ b/lightcards/display.py @@ -244,9 +244,9 @@ class Display: self.win = stdscr curses.curs_set(0) # Hide cursor curses.use_default_colors() # Allow transparency - curses.init_pair(1, curses.COLOR_CYAN, -1) - curses.init_pair(2, curses.COLOR_RED, -1) - curses.init_pair(3, curses.COLOR_YELLOW, -1) + curses.init_pair(1, self.config["highlight_color"], -1) + curses.init_pair(2, self.config["error_color"], -1) + curses.init_pair(3, self.config["starred_color"], -1) self.main_panel = curses.panel.new_panel(self.win) self.menu_obj = Menu(self)