class documentation
class AdvancedGradientPalette(Palette):
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)
| Method | __init__ |
Creates an advanced gradient palette |
| Method | _get |
Returns the color corresponding to the given color index. |
| Instance Variable | _colors |
Undocumented |
| Instance Variable | _dists |
Undocumented |
| Instance Variable | _indices |
Undocumented |
Inherited from Palette:
| Method | __len__ |
Returns the number of colors in this palette |
| Method | __plot__ |
Plots the colors of the palette on the given Cairo context |
| Method | __repr__ |
Undocumented |
| Method | clear |
Clears the result cache. |
| Method | get |
Returns the given color from the palette. |
| Method | get |
Returns multiple colors from the palette. |
| Property | length |
Returns the number of colors in this palette |
| Instance Variable | _cache |
Undocumented |
| Instance Variable | _length |
Undocumented |
overrides
igraph.drawing.colors.Palette.__init__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
igraph.drawing.colors.Palette._getReturns 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 | |