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: Creates a gradient palette.
  
  @param color1: the color where the gradient starts.
  @param color2: the color where the gradient ends.
  @param n: the number of colors in the palette.
docstr_tok: ["Creates","a","gradient","palette",".","@","param","color1",":","the","color","where","the","gradient","starts",".","@","param","color2",":","the","color","where","the","gradient","ends",".","@","param","n",":","the","number","of","colors","in","the","palette","."]
code: def __init__(self, color1, color2, n=256):
      """Creates a gradient palette.
  
      @param color1: the color where the gradient starts.
      @param color2: the color where the gradient ends.
      @param n: the number of colors in the palette.
      """
      super().__init__(n)
      self._color1 = color_name_to_rgba(color1)
      self._color2 = color_name_to_rgba(color2)
  
imports: from abc import ABCMeta, abstractmethod
  from math import ceil
label_desc: Use image node_id 1 to create a new GradientPalette object from inherited base classes: Palette with example: obj = GradientPalette(color1, color2, n)