summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2009-12-06 14:31:48 +0100
committerhut <hut@lavabit.com>2009-12-06 14:31:48 +0100
commit7c5c70fd87e79db6d6010c6e8ae3dd6d09d5e2b5 (patch)
treec55fce1cf6a14f6bec21cd03dcaaf17fd3f5724a /ranger
parent47d269365a9789646a06cdc6f533999561c7fef4 (diff)
downloadranger-7c5c70fd87e79db6d6010c6e8ae3dd6d09d5e2b5.tar.gz
Renamed / added colorschemes
Renamed Snow to Default
Added a new black/white colorscheme which deserves the name Snow more.
Diffstat (limited to 'ranger')
-rw-r--r--ranger/colorschemes/default.py57
-rw-r--r--ranger/colorschemes/snow.py37
-rw-r--r--ranger/defaults/options.py2
3 files changed, 58 insertions, 38 deletions
diff --git a/ranger/colorschemes/default.py b/ranger/colorschemes/default.py
new file mode 100644
index 00000000..ac54bf7f
--- /dev/null
+++ b/ranger/colorschemes/default.py
@@ -0,0 +1,57 @@
+from ranger.gui.colorscheme import ColorScheme
+from ranger.gui.color import *
+
+class Default(ColorScheme):
+	def use(self, context):
+		fg, bg, attr = default_colors
+
+		if context.reset:
+			pass
+
+		elif context.in_display:
+			if context.selected:
+				attr = reverse
+			else:
+				attr = normal
+
+			if context.empty or context.error:
+				bg = red
+
+			if context.media:
+				if context.image:
+					fg = yellow
+				else:
+					fg = magenta
+
+			if context.container:
+				fg = red
+
+			if context.document:
+				fg = default
+
+			if context.directory:
+				fg = blue
+
+			elif context.executable and not any((context.media, context.container, context.document)):
+				attr |= bold
+				fg = green
+
+			if context.link:
+				fg = cyan
+
+			if context.maindisplay and context.selected:
+				attr |= bold
+
+		elif context.in_titlebar:
+			attr |= bold
+
+			if context.hostname:
+				fg = green
+
+			elif context.directory:
+				fg = blue
+
+			elif context.link:
+				fg = cyan
+
+		return fg, bg, attr
diff --git a/ranger/colorschemes/snow.py b/ranger/colorschemes/snow.py
index baad5e43..8e7da043 100644
--- a/ranger/colorschemes/snow.py
+++ b/ranger/colorschemes/snow.py
@@ -14,44 +14,7 @@ class Snow(ColorScheme):
 			else:
 				attr = normal
 
-			if context.empty or context.error:
-				bg = red
-
-			if context.media:
-				if context.image:
-					fg = yellow
-				else:
-					fg = magenta
-
-			if context.container:
-				fg = red
-
-			if context.document:
-				fg = default
-
 			if context.directory:
-				fg = blue
-
-			elif context.executable and not any((context.media, context.container, context.document)):
-				attr |= bold
-				fg = green
-
-			if context.link:
-				fg = cyan
-
-			if context.maindisplay and context.selected:
 				attr |= bold
 
-		elif context.in_titlebar:
-			attr |= bold
-
-			if context.hostname:
-				fg = green
-
-			elif context.directory:
-				fg = blue
-
-			elif context.link:
-				fg = cyan
-
 		return fg, bg, attr
diff --git a/ranger/defaults/options.py b/ranger/defaults/options.py
index 8d44089f..d3eeef84 100644
--- a/ranger/defaults/options.py
+++ b/ranger/defaults/options.py
@@ -1,6 +1,6 @@
 from ranger import colorschemes
 
-colorscheme = colorschemes.snow
+colorscheme = colorschemes.default
 
 show_hidden = False