class_docstr: Base class for gradient palettes
  
  Gradient palettes contain a gradient between two given colors.
  
  Example:
  
    >>> pal = GradientPalette("red", "blue", 5)
    >>> pal.get(0)
    (1.0, 0.0, 0.0, 1.0)
    >>> pal.get(2)
    (0.5, 0.0, 0.5, 1.0)
    >>> pal.get(4)
    (0.0, 0.0, 1.0, 1.0)
class_docstr_tok: ["Base","class","for","gradient","palettes","Gradient","palettes","contain","a","gradient","between","two","given","colors",".","Example",":",">",">",">","pal","=","GradientPalette","(","``","red","''",",","``","blue","''",",","5",")",">",">",">","pal.get","(","0",")","(","1.0",",","0.0",",","0.0",",","1.0",")",">",">",">","pal.get","(","2",")","(","0.5",",","0.0",",","0.5",",","1.0",")",">",">",">","pal.get","(","4",")","(","0.0",",","0.0",",","1.0",",","1.0",")"]
docstr: Returns the color corresponding to the given color index.
  
  @param v: numerical index of the color to be retrieved
  @return: a 4-tuple containing the RGBA values
docstr_tok: ["Returns","the","color","corresponding","to","the","given","color","index",".","@","param","v",":","numerical","index","of","the","color","to","be","retrieved","@","return",":","a","4-tuple","containing","the","RGBA","values"]
code: def _get(self, v):
      """Returns the color corresponding to the given color index.
  
      @param v: numerical index of the color to be retrieved
      @return: a 4-tuple containing the RGBA values"""
      ratio = float(v) / (len(self) - 1)
      return tuple(
          self._color1[x] * (1 - ratio) + self._color2[x] * ratio
          for x in range(4)
      )
  
imports: from abc import ABCMeta, abstractmethod
  from math import ceil
label_desc: Use image node_id 2 for calling the GradientPalette obj's underlying member method code with example usage: obj._get(v) and returns: tuple