# ``igraph`.`drawing`.`colors`.`PrecalculatedPalette``

class documentation

`class PrecalculatedPalette(Palette): (source)`

Known subclasses: `igraph.drawing.colors.ClusterColoringPalette`

Constructor: `PrecalculatedPalette(items)`

View In Hierarchy

A palette that returns colors from a pre-calculated list of colors

Method | `__init__` | Creates the palette backed by the given list. The list must contain RGBA quadruplets or color names, which will be resolved first by `color_name_to_rgba()`. Anything that is understood by `color_name_to_rgba()`...
Method | `_get` | This method will only be called if the requested color index is outside the size of the palette. In that case, we throw an exception

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/mpl Axes
Method | `__repr__` | Undocumented
Method | `clear_cache` | Clears the result cache.
Method | `get` | Returns the given color from the palette.
Method | `get_many` | Returns multiple colors from the palette.
Property | `length` | Returns the number of colors in this palette
Instance Variable | `_cache` | Undocumented
Instance Variable | `_length` | Undocumented

def __init__(self, items): (source)
overrides `igraph.drawing.colors.Palette.__init__`
overridden in `igraph.drawing.colors.ClusterColoringPalette`

Creates the palette backed by the given list. The list must contain RGBA quadruplets or color names, which will be resolved first by `color_name_to_rgba()`. Anything that is understood by `color_name_to_rgba()` is OK here.

def _get(self, v): (source)
overrides `igraph.drawing.colors.Palette._get`

This method will only be called if the requested color index is outside the size of the palette. In that case, we throw an exception