class ClusterColoringPalette(PrecalculatedPalette):
A palette suitable for coloring vertices when plotting a clustering.
This palette tries to make sure that the colors are easily distinguishable. This is achieved by using a set of base colors and their lighter and darker variants, depending on the number of elements in the palette.
When the desired size of the palette is less than or equal to the number of base colors (denoted by n), only the bsae colors will be used. When the size of the palette is larger than n but less than 2*n, the base colors and their lighter variants will be used. Between 2*n and 3*n, the base colors and their lighter and darker variants will be used. Above 3*n, more darker and lighter variants will be generated, but this makes the individual colors less and less distinguishable.
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() ... |
Inherited from PrecalculatedPalette
:
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
(via PrecalculatedPalette
):
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 |
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.