diff options
author | hut <hut@lavabit.com> | 2010-01-06 00:37:07 +0100 |
---|---|---|
committer | hut <hut@lavabit.com> | 2010-01-06 00:37:07 +0100 |
commit | fca1fc4f52502559d2acd4b5a077fdc849a187d9 (patch) | |
tree | 6c9a327aa9f843954ff57d33471844d7844c7971 /ranger | |
parent | 9ec914e306514c7a6f0cf3d401e97712dc197501 (diff) | |
download | ranger-fca1fc4f52502559d2acd4b5a077fdc849a187d9.tar.gz |
color: added docstring
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/gui/color.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/ranger/gui/color.py b/ranger/gui/color.py index 1318ab6f..bf80929a 100644 --- a/ranger/gui/color.py +++ b/ranger/gui/color.py @@ -1,10 +1,24 @@ -"""Contains abbreviations to curses' color/attribute constants.""" +""" +Contains abbreviations to curses color/attribute constants. + +Multiple attributes can be combined with the | (or) operator, toggled +with ^ (xor) and checked for with & (and). Examples: + +attr = bold | underline +attr |= reverse +bool(attr & reverse) # => True +attr ^= reverse +bool(attr & reverse) # => False +""" + import curses COLOR_PAIRS = {10: 0} def get_color(fg, bg): - """Returns the color pair for the given fg/bg combination.""" + """ + Returns the curses color pair for the given fg/bg combination. + """ c = bg+2 + 9*(fg + 2) |