class_docstr: Base class of color palettes.
  
  Color palettes are mappings that assign integers from the range
  0..M{n-1} to colors (4-tuples). M{n} is called the size or length
  of the palette. C{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 L{Palette._get} method as necessary.
  
  Palettes can also be used as lists or dicts, for the C{__getitem__}
  method is overridden properly to call L{Palette.get}.
class_docstr_tok: ["Base","class","of","color","palettes",".","Color","palettes","are","mappings","that","assign","integers","from","the","range","0","..","M","{","n-1","}","to","colors","(","4-tuples",")",".","M","{","n","}","is","called","the","size","or","length","of","the","palette",".","C","{","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","L","{","Palette._get","}","method","as","necessary",".","Palettes","can","also","be","used","as","lists","or","dicts",",","for","the","C","{","__getitem__","}","method","is","overridden","properly","to","call","L","{","Palette.get","}","."]
code: def __init__(self, n):
      self._length = n
      self._cache = {}
  
imports: from abc import ABCMeta, abstractmethod
  from math import ceil
label_desc: Use image node_id 1 to create a new Palette object  with example: obj = Palette(n)