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","}","."]
docstr: Override this method in a subclass to create a custom palette.
  
  You can safely assume that v is an integer in the range 0..M{n-1}
  where M{n} is the size of the palette.
  
  @param v: numerical index of the color to be retrieved
  @return: a 4-tuple containing the RGBA values
docstr_tok: ["Override","this","method","in","a","subclass","to","create","a","custom","palette",".","You","can","safely","assume","that","v","is","an","integer","in","the","range","0","..","M","{","n-1","}","where","M","{","n","}","is","the","size","of","the","palette",".","@","param","v",":","numerical","index","of","the","color","to","be","retrieved","@","return",":","a","4-tuple","containing","the","RGBA","values"]
code: def _get(self, v):
      """Override this method in a subclass to create a custom palette.
  
      You can safely assume that v is an integer in the range 0..M{n-1}
      where M{n} is the size of the palette.
  
      @param v: numerical index of the color to be retrieved
      @return: a 4-tuple containing the RGBA values"""
      raise NotImplementedError
  
imports: from abc import ABCMeta, abstractmethod
  from math import ceil
label_desc: Use image node_id 5 for calling the Palette obj's underlying member method code with example usage: obj._get(v) without return types