]> git.armaanb.net Git - lightcards.git/commitdiff
Implement color customization config option
authorArmaan Bhojwani <me@armaanb.net>
Sat, 13 Feb 2021 18:00:46 +0000 (13:00 -0500)
committerArmaan Bhojwani <me@armaanb.net>
Sat, 13 Feb 2021 18:02:51 +0000 (13:02 -0500)
config.py
lightcards/display.py

index e12faa3f25da77544242624193936d3dc877a240..32b75ef0132876aa4db37e44ad87252a37648531 100644 (file)
--- a/config.py
+++ b/config.py
@@ -1,6 +1,7 @@
 ###############################################################################
 # LIGHTCARDS DEFAULT CONFIG FILE                                              #
 ###############################################################################
 ###############################################################################
 # LIGHTCARDS DEFAULT CONFIG FILE                                              #
 ###############################################################################
+import curses
 
 ###############################################################################
 # STARTUP OPTIONS
 
 ###############################################################################
 # STARTUP OPTIONS
@@ -17,8 +18,9 @@ default_view = 1
 
 progress_char = "»"
 
 
 progress_char = "»"
 
-highlight_color = "green"
-starred_color = "yellow"
+highlight_color = curses.COLOR_CYAN
+starred_color = curses.COLOR_YELLOW
+error_color = curses.COLOR_RED
 
 ###############################################################################
 # KEYBINDINGS
 
 ###############################################################################
 # KEYBINDINGS
index f5f5f6c57d0d4991d40e6a457879eab5642fa895..8e19d3c49f57fd9c7ed69dd5ab21ff39475de03f 100644 (file)
@@ -244,9 +244,9 @@ class Display:
         self.win = stdscr
         curses.curs_set(0)  # Hide cursor
         curses.use_default_colors()  # Allow transparency
         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)
 
         self.main_panel = curses.panel.new_panel(self.win)
         self.menu_obj = Menu(self)