|
@ -5,17 +5,24 @@ from __future__ import (absolute_import, division, print_function) |
|
|
|
|
|
|
|
|
from ranger.gui.colorscheme import ColorScheme |
|
|
from ranger.gui.colorscheme import ColorScheme |
|
|
from ranger.gui.color import ( |
|
|
from ranger.gui.color import ( |
|
|
black, blue, cyan, green, magenta, red, white, yellow, default, |
|
|
|
|
|
normal, bold, reverse, dim, BRIGHT, |
|
|
|
|
|
default_colors, |
|
|
|
|
|
|
|
|
default, normal, bold, reverse, dim, BRIGHT, default_colors, |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
black = 16 |
|
|
|
|
|
blue = 32 |
|
|
|
|
|
cyan = 50 |
|
|
|
|
|
green = 47 |
|
|
|
|
|
magenta = 141 |
|
|
|
|
|
red = 9 |
|
|
|
|
|
white = 255 |
|
|
|
|
|
yellow =227 |
|
|
|
|
|
|
|
|
class Default(ColorScheme): |
|
|
class Default(ColorScheme): |
|
|
progress_bar_color = blue |
|
|
|
|
|
|
|
|
progress_bar_color = 87 |
|
|
|
|
|
|
|
|
def use(self, context): # pylint: disable=too-many-branches,too-many-statements |
|
|
def use(self, context): # pylint: disable=too-many-branches,too-many-statements |
|
|
fg, bg, attr = default_colors |
|
|
|
|
|
|
|
|
fg, bg, attr = 231, black, bold |
|
|
|
|
|
|
|
|
if context.reset: |
|
|
if context.reset: |
|
|
return default_colors |
|
|
return default_colors |
|
@ -39,22 +46,18 @@ class Default(ColorScheme): |
|
|
if context.directory: |
|
|
if context.directory: |
|
|
attr |= bold |
|
|
attr |= bold |
|
|
fg = blue |
|
|
fg = blue |
|
|
fg += BRIGHT |
|
|
|
|
|
elif context.executable and not \ |
|
|
elif context.executable and not \ |
|
|
any((context.media, context.container, |
|
|
any((context.media, context.container, |
|
|
context.fifo, context.socket)): |
|
|
context.fifo, context.socket)): |
|
|
attr |= bold |
|
|
attr |= bold |
|
|
fg = green |
|
|
fg = green |
|
|
fg += BRIGHT |
|
|
|
|
|
if context.socket: |
|
|
if context.socket: |
|
|
attr |= bold |
|
|
attr |= bold |
|
|
fg = magenta |
|
|
fg = magenta |
|
|
fg += BRIGHT |
|
|
|
|
|
if context.fifo or context.device: |
|
|
if context.fifo or context.device: |
|
|
fg = yellow |
|
|
fg = yellow |
|
|
if context.device: |
|
|
if context.device: |
|
|
attr |= bold |
|
|
attr |= bold |
|
|
fg += BRIGHT |
|
|
|
|
|
if context.link: |
|
|
if context.link: |
|
|
fg = cyan if context.good else magenta |
|
|
fg = cyan if context.good else magenta |
|
|
if context.tag_marker and not context.selected: |
|
|
if context.tag_marker and not context.selected: |
|
@ -63,11 +66,9 @@ class Default(ColorScheme): |
|
|
fg = white |
|
|
fg = white |
|
|
else: |
|
|
else: |
|
|
fg = red |
|
|
fg = red |
|
|
fg += BRIGHT |
|
|
|
|
|
if not context.selected and (context.cut or context.copied): |
|
|
if not context.selected and (context.cut or context.copied): |
|
|
attr |= bold |
|
|
attr |= bold |
|
|
fg = black |
|
|
fg = black |
|
|
fg += BRIGHT |
|
|
|
|
|
# If the terminal doesn't support bright colors, use dim white |
|
|
# If the terminal doesn't support bright colors, use dim white |
|
|
# instead of black. |
|
|
# instead of black. |
|
|
if BRIGHT == 0: |
|
|
if BRIGHT == 0: |
|
@ -111,16 +112,13 @@ class Default(ColorScheme): |
|
|
if context.marked: |
|
|
if context.marked: |
|
|
attr |= bold | reverse |
|
|
attr |= bold | reverse |
|
|
fg = yellow |
|
|
fg = yellow |
|
|
fg += BRIGHT |
|
|
|
|
|
if context.frozen: |
|
|
if context.frozen: |
|
|
attr |= bold | reverse |
|
|
attr |= bold | reverse |
|
|
fg = cyan |
|
|
fg = cyan |
|
|
fg += BRIGHT |
|
|
|
|
|
if context.message: |
|
|
if context.message: |
|
|
if context.bad: |
|
|
if context.bad: |
|
|
attr |= bold |
|
|
attr |= bold |
|
|
fg = red |
|
|
fg = red |
|
|
fg += BRIGHT |
|
|
|
|
|
if context.loaded: |
|
|
if context.loaded: |
|
|
bg = self.progress_bar_color |
|
|
bg = self.progress_bar_color |
|
|
if context.vcsinfo: |
|
|
if context.vcsinfo: |
|
|