about summary refs log blame commit diff stats
path: root/doc/pydoc/ranger.gui.colorscheme.html
blob: 6e14b5ca010dc492015f3ddbc52ad255c93e4936 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
 

                                                                






                                                                                                                                                                                                                                                  
                                                                                                                                                                                                         
























                                                                                                                                          







                                                                                                  
                                                                                          









                                                                                                   
                                                                                                                                                                                     
    






                                                                                                                                          


                                                                                    



                                                                                                                                                                              
 


                                                                                                                                                                                        














                                                                                                                                                                                                 
                      
                                      
                                                                                                    
    


                                                                                             
             
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module ranger.gui.colorscheme</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<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/ranger/ranger/gui/colorscheme.py">/home/hut/ranger/ranger/gui/colorscheme.py</a></font></td></tr></table>
    <p><tt>Colorschemes&nbsp;define&nbsp;colors&nbsp;for&nbsp;specific&nbsp;contexts.<br>
&nbsp;<br>
Generally,&nbsp;this&nbsp;works&nbsp;by&nbsp;passing&nbsp;a&nbsp;set&nbsp;of&nbsp;keywords&nbsp;(strings)&nbsp;to<br>
the&nbsp;colorscheme.get()&nbsp;method&nbsp;to&nbsp;receive&nbsp;the&nbsp;tuple&nbsp;(fg,&nbsp;bg,&nbsp;attr).<br>
fg,&nbsp;bg&nbsp;are&nbsp;the&nbsp;foreground&nbsp;and&nbsp;background&nbsp;colors&nbsp;and&nbsp;attr&nbsp;is&nbsp;the&nbsp;attribute.<br>
The&nbsp;values&nbsp;are&nbsp;specified&nbsp;in&nbsp;ranger.gui.color.<br>
&nbsp;<br>
A&nbsp;colorscheme&nbsp;must...<br>
&nbsp;<br>
1.&nbsp;be&nbsp;inside&nbsp;either&nbsp;of&nbsp;these&nbsp;directories:<br>
~/.ranger/colorschemes/<br>
path/to/ranger/colorschemes/<br>
&nbsp;<br>
2.&nbsp;be&nbsp;a&nbsp;subclass&nbsp;of&nbsp;ranger.gui.colorscheme.<a href="#ColorScheme">ColorScheme</a><br>
&nbsp;<br>
3.&nbsp;implement&nbsp;a&nbsp;use(self,&nbsp;context)&nbsp;method&nbsp;which&nbsp;returns&nbsp;(fg,&nbsp;bg,&nbsp;attr).<br>
context&nbsp;is&nbsp;a&nbsp;struct&nbsp;which&nbsp;contains&nbsp;all&nbsp;entries&nbsp;of&nbsp;CONTEXT_KEYS,<br>
associated&nbsp;with&nbsp;either&nbsp;True&nbsp;or&nbsp;False.<br>
&nbsp;<br>
define&nbsp;which&nbsp;colorscheme&nbsp;to&nbsp;use&nbsp;by&nbsp;having&nbsp;this&nbsp;to&nbsp;your&nbsp;options.py:<br>
from&nbsp;ranger&nbsp;import&nbsp;colorschemes<br>
colorscheme&nbsp;=&nbsp;colorschemes.filename<br>
&nbsp;<br>
If&nbsp;your&nbsp;colorscheme-file&nbsp;contains&nbsp;more&nbsp;than&nbsp;one&nbsp;colorscheme,&nbsp;specify&nbsp;it&nbsp;with:<br>
colorscheme&nbsp;=&nbsp;colorschemes.filename.classname</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.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>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="ColorScheme">class <strong>ColorScheme</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>This&nbsp;is&nbsp;the&nbsp;class&nbsp;that&nbsp;colorschemes&nbsp;must&nbsp;inherit&nbsp;from.<br>
&nbsp;<br>
it&nbsp;defines&nbsp;<a href="#ColorScheme-get">get</a>()&nbsp;<br>
it&nbsp;defines&nbsp;the&nbsp;<a href="#ColorScheme-get">get</a>()&nbsp;method,&nbsp;which&nbsp;returns&nbsp;the&nbsp;color&nbsp;tuple<br>
which&nbsp;fits&nbsp;to&nbsp;the&nbsp;given&nbsp;keys.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">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&nbsp;the&nbsp;(fg,&nbsp;bg,&nbsp;attr)&nbsp;for&nbsp;the&nbsp;given&nbsp;keys.<br>
&nbsp;<br>
Using&nbsp;this&nbsp;function&nbsp;rather&nbsp;than&nbsp;<a href="#ColorScheme-use">use</a>()&nbsp;will&nbsp;cache&nbsp;all<br>
colors&nbsp;for&nbsp;faster&nbsp;access.</tt></dd></dl>

<dl><dt><a name="ColorScheme-get_attr"><strong>get_attr</strong></a>(self, *keys)</dt><dd><tt>Returns&nbsp;the&nbsp;curses&nbsp;attribute&nbsp;for&nbsp;the&nbsp;specified&nbsp;keys<br>
&nbsp;<br>
Ready&nbsp;to&nbsp;use&nbsp;for&nbsp;curses.setattr()</tt></dd></dl>

<dl><dt><a name="ColorScheme-use"><strong>use</strong></a>(self, context)</dt><dd><tt>Use&nbsp;the&nbsp;colorscheme&nbsp;to&nbsp;determine&nbsp;the&nbsp;(fg,&nbsp;bg,&nbsp;attr)&nbsp;tuple.<br>
This&nbsp;is&nbsp;a&nbsp;dummy&nbsp;function&nbsp;which&nbsp;always&nbsp;returns&nbsp;default_colors.<br>
Override&nbsp;this&nbsp;in&nbsp;your&nbsp;custom&nbsp;colorscheme!</tt></dd></dl>

<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</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>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
    
<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt><a name="-color_pair"><strong>color_pair</strong></a>(...)</dt></dl>
</td></tr></table>
</body></html>