python-igraph manual

For using igraph from Python

   Home       Trees       Indices       Help   
Package igraph :: Package drawing :: Module colors :: Class AdvancedGradientPalette
[hide private]

Class AdvancedGradientPalette

source code

object --+    
         |    
   Palette --+
             |
            AdvancedGradientPalette

Advanced gradient that consists of more than two base colors.

Example:

>>> pal = AdvancedGradientPalette(["red", "black", "blue"], n=9)
>>> pal.get(2)
(0.5, 0.0, 0.0, 1.0)
>>> pal.get(7)
(0.0, 0.0, 0.75, 1.0)
Instance Methods [hide private]
 
__init__(self, colors, indices=None, n=256)
Creates an advanced gradient palette
source code
 
_get(self, v)
Returns the color corresponding to the given color index.
source code

Inherited from Palette: __getitem__, __len__, __plot__, __repr__, clear_cache, get, get_many

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from Palette: length

Inherited from object: __class__

Method Details [hide private]

__init__(self, colors, indices=None, n=256)
(Constructor)

source code 

Creates an advanced gradient palette

Parameters:
  • colors - the colors in the gradient.
  • indices - the color indices belonging to the given colors. If None, the colors are distributed equidistantly
  • n - the total number of colors in the palette
Overrides: object.__init__

_get(self, v)

source code 

Returns the color corresponding to the given color index.

Parameters:
  • v - numerical index of the color to be retrieved
Returns:
a 4-tuple containing the RGBA values
Overrides: Palette._get

   Home       Trees       Indices       Help