|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module ranger.gui.colorscheme</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="ranger.html"><font color="#ffffff">ranger</font></a>.<a href="ranger.gui.html"><font color="#ffffff">gui</font></a>.colorscheme</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/hut/code/ranger/ranger/gui/colorscheme.py">/home/hut/code/ranger/ranger/gui/colorscheme.py</a></font></td></tr></table>
<p><tt>Colorschemes define colors for specific contexts.<br>
<br>
Generally, this works by passing a set of keywords (strings) to<br>
the colorscheme.get() method to receive the tuple (fg, bg, attr).<br>
fg, bg are the foreground and background colors and attr is the attribute.<br>
The values are specified in ranger.gui.color.<br>
<br>
A colorscheme must...<br>
<br>
1. be inside either of these directories:<br>
~/.ranger/colorschemes/<br>
path/to/ranger/colorschemes/<br>
<br>
2. be a subclass of ranger.gui.colorscheme.<a href="#ColorScheme">ColorScheme</a><br>
<br>
3. implement a use(self, context) method which returns (fg, bg, attr).<br>
context is a struct which contains all entries of CONTEXT_KEYS,<br>
associated with either True or False.<br>
<br>
define which colorscheme to use by having this to your options.py:<br>
from ranger import colorschemes<br>
colorscheme = colorschemes.filename<br>
<br>
If your colorscheme-file contains more than one colorscheme, specify it with:<br>
colorscheme = colorschemes.filename.classname</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="os.html">os</a><br>
</td><td width="25%" valign=top><a href="ranger.html">ranger</a><br>
</td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="ranger.shared.settings.html#SettingsAware">ranger.shared.settings.SettingsAware</a>(<a href="builtins.html#object">builtins.object</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="ranger.gui.colorscheme.html#ColorScheme">ColorScheme</a>
</font></dt></dl>
</dd>
</dl>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="ColorScheme">class <strong>ColorScheme</strong></a>(<a href="ranger.shared.settings.html#SettingsAware">ranger.shared.settings.SettingsAware</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>This is the class that colorschemes must inherit from.<br>
<br>
it defines <a href="#ColorScheme-get">get</a>() <br>
it defines the <a href="#ColorScheme-get">get</a>() method, which returns the color tuple<br>
which fits to the given keys.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="ranger.gui.colorscheme.html#ColorScheme">ColorScheme</a></dd>
<dd><a href="ranger.shared.settings.html#SettingsAware">ranger.shared.settings.SettingsAware</a></dd>
<dd><a href="builtins.html#object">builtins.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="ColorScheme-__init__"><strong>__init__</strong></a>(self)</dt></dl>
<dl><dt><a name="ColorScheme-get"><strong>get</strong></a>(self, *keys)</dt><dd><tt>Returns the (fg, bg, attr) for the given keys.<br>
<br>
Using this function rather than <a href="#ColorScheme-use">use</a>() will cache all<br>
colors for faster access.</tt></dd></dl>
<dl><dt><a name="ColorScheme-get_attr"><strong>get_attr</strong></a>(self, *keys)</dt><dd><tt>Returns the curses attribute for the specified keys<br>
<br>
Ready to use for curses.setattr()</tt></dd></dl>
<dl><dt><a name="ColorScheme-use"><strong>use</strong></a>(self, context)</dt><dd><tt>Use the colorscheme to determine the (fg, bg, attr) tuple.<br>
<br>
When no colorscheme is found, ranger will fall back to this very<br>
basic colorscheme where directories are blue and bold, and<br>
selected files have the color inverted.<br>
<br>
Override this method in your own colorscheme.</tt></dd></dl>
<hr>
Data descriptors inherited from <a href="ranger.shared.settings.html#SettingsAware">ranger.shared.settings.SettingsAware</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
<hr>
Data and other attributes inherited from <a href="ranger.shared.settings.html#SettingsAware">ranger.shared.settings.SettingsAware</a>:<br>
<dl><dt><strong>settings</strong> = {}</dl>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
<tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td>
<td width="100%"><dl><dt><a name="-color_pair"><strong>color_pair</strong></a>(...)</dt></dl>
</td></tr></table>
</body></html>
|