summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/gui/color.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/ranger/gui/color.py b/ranger/gui/color.py
index 6c73f99a..b118a0af 100644
--- a/ranger/gui/color.py
+++ b/ranger/gui/color.py
@@ -20,14 +20,13 @@ COLOR_PAIRS = {10: 0}
 def get_color(fg, bg):
     """Returns the curses color pair for the given fg/bg combination."""
 
-    c = bg+2 + 9*(fg + 2)
-
-    if c not in COLOR_PAIRS:
+    key = (fg, bg)
+    if key not in COLOR_PAIRS:
         size = len(COLOR_PAIRS)
         curses.init_pair(size, fg, bg)
-        COLOR_PAIRS[c] = size
+        COLOR_PAIRS[key] = size
 
-    return COLOR_PAIRS[c]
+    return COLOR_PAIRS[key]
 
 black   = curses.COLOR_BLACK
 blue    = curses.COLOR_BLUE