Nicholas Riley avatar Nicholas Riley committed 2710e45

Don't assume a black background.

Comments (0)

Files changed (1)

crecord/chunk_selector.py

             colorPair = self.colorPairNames[pairName]
         else:
             if fgColor is None:
-                fgColor = curses.COLOR_WHITE
+                fgColor = -1
             if bgColor is None:
-                bgColor = curses.COLOR_BLACK
+                bgColor = -1
             if self.colorPairs.has_key((fgColor,bgColor)):
                 colorPair = self.colorPairs[(fgColor,bgColor)]
             else:
             colorPair = self.colorPairNames[name]
         else:
             if fgColor is None:
-                fgColor = curses.COLOR_WHITE
+                fgColor = -1
             if bgColor is None:
-                bgColor = curses.COLOR_BLACK
+                bgColor = -1
             if self.colorPairs.has_key((fgColor,bgColor)):
                 colorPair = self.colorPairs[(fgColor,bgColor)]
             else:
         self.stdscr = stdscr
         self.yScreenSize, self.xScreenSize = self.stdscr.getmaxyx()
 
+        curses.start_color()
+        curses.use_default_colors()
+
         # available colors: black, blue, cyan, green, magenta, white, yellow
         # init_pair(color_id, foreground_color, background_color)
-        self.initColorPair(curses.COLOR_WHITE, curses.COLOR_BLACK, name="normal")
-        self.initColorPair(curses.COLOR_WHITE, curses.COLOR_RED, name="selected")
-        self.initColorPair(curses.COLOR_RED, curses.COLOR_BLACK, name="deletion")
-        self.initColorPair(curses.COLOR_GREEN, curses.COLOR_BLACK, name="addition")
+        self.initColorPair(None, None, name="normal")
+        self.initColorPair(curses.COLOR_WHITE, curses.COLOR_MAGENTA, name="selected")
+        self.initColorPair(curses.COLOR_RED, None, name="deletion")
+        self.initColorPair(curses.COLOR_GREEN, None, name="addition")
         self.initColorPair(curses.COLOR_WHITE, curses.COLOR_BLUE, name="legend")
         # newwin([height, width,] begin_y, begin_x)
         self.statuswin = curses.newwin(self.numStatusLines,0,0,0)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.