| Home | Trees | Indices | Help |
|
|---|
|
|
object --+
|
Palette
Base class of color palettes.
Color palettes are mappings that assign integers from the range 0..n-1 to colors (3-tuples). n is
called the size or length of the palette. igraph comes with
a number of predefined palettes, so this class is useful for you only if
you want to define your own palette. This can be done by subclassing this
class and implementing the Palette._get method as necessary.
__getitem__ method is overridden properly to call Palette.get.
|
|||
|
__getitem__(self,
v) Returns the given color from the palette. |
||
|
__init__(self,
n) x.__init__(...) initializes x; see x.__class__.__doc__ for signature |
||
| __len__(self) | ||
|
_get(self,
v) Override this method in a subclass to create a custom palette. |
||
| _get_length(self) | ||
|
clear_cache(self) Clears the result cache. |
||
|
get(self,
v) Returns the given color from the palette. |
||
|
Inherited from |
|||
|
|||
| length | ||
|
Inherited from |
|||
|
|||
Returns the given color from the palette. Values are cached: if the specific value given has already been looked upon, its value will be returned from the cache instead of calculating it again. Use Palette.clear_cache to clear the cache if necessary.
|
|
|
Override this method in a subclass to create a custom palette. You can safely assume that v is an integer in the range 0..n-1 where n is the size of the palette.
|
|
Clears the result cache. The return values of Palette.get are cached. Use this method to clear the cache. |
Returns the given color from the palette. Values are cached: if the specific value given has already been looked upon, its value will be returned from the cache instead of calculating it again. Use Palette.clear_cache to clear the cache if necessary.
|
|
|||
lengthNone
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0alpha3 on Thu Feb 14 12:44:01 2008 | http://epydoc.sourceforge.net |