class_docstr: A palette that varies the hue of the colors along a scale.
  
  Colors in a rainbow palette all have the same saturation, value and
  alpha components, while the hue is varied between two given extremes
  linearly. This palette has the advantage that it wraps around nicely
  if the hue is varied between zero and one (which is the default).
  
  Example:
  
      >>> pal = RainbowPalette(n=120)
      >>> pal.get(0)
      (1.0, 0.0, 0.0, 1.0)
      >>> pal.get(20)
      (1.0, 1.0, 0.0, 1.0)
      >>> pal.get(40)
      (0.0, 1.0, 0.0, 1.0)
      >>> pal = RainbowPalette(n=120, s=1, v=0.5, alpha=0.75)
      >>> pal.get(60)
      (0.0, 0.5, 0.5, 0.75)
      >>> pal.get(80)
      (0.0, 0.0, 0.5, 0.75)
      >>> pal.get(100)
      (0.5, 0.0, 0.5, 0.75)
      >>> pal = RainbowPalette(n=120)
      >>> pal2 = RainbowPalette(n=120, start=0.5, end=0.5)
      >>> pal.get(60) == pal2.get(0)
      True
      >>> pal.get(90) == pal2.get(30)
      True
  
  This palette was modeled after the C{rainbow} command of R.
class_docstr_tok: ["A","palette","that","varies","the","hue","of","the","colors","along","a","scale",".","Colors","in","a","rainbow","palette","all","have","the","same","saturation",",","value","and","alpha","components",",","while","the","hue","is","varied","between","two","given","extremes","linearly",".","This","palette","has","the","advantage","that","it","wraps","around","nicely","if","the","hue","is","varied","between","zero","and","one","(","which","is","the","default",")",".","Example",":",">",">",">","pal","=","RainbowPalette","(","n=120",")",">",">",">","pal.get","(","0",")","(","1.0",",","0.0",",","0.0",",","1.0",")",">",">",">","pal.get","(","20",")","(","1.0",",","1.0",",","0.0",",","1.0",")",">",">",">","pal.get","(","40",")","(","0.0",",","1.0",",","0.0",",","1.0",")",">",">",">","pal","=","RainbowPalette","(","n=120",",","s=1",",","v=0.5",",","alpha=0.75",")",">",">",">","pal.get","(","60",")","(","0.0",",","0.5",",","0.5",",","0.75",")",">",">",">","pal.get","(","80",")","(","0.0",",","0.0",",","0.5",",","0.75",")",">",">",">","pal.get","(","100",")","(","0.5",",","0.0",",","0.5",",","0.75",")",">",">",">","pal","=","RainbowPalette","(","n=120",")",">",">",">","pal2","=","RainbowPalette","(","n=120",",","start=0.5",",","end=0.5",")",">",">",">","pal.get","(","60",")","==","pal2.get","(","0",")","True",">",">",">","pal.get","(","90",")","==","pal2.get","(","30",")","True","This","palette","was","modeled","after","the","C","{","rainbow","}","command","of","R","."]
docstr: Creates a rainbow palette.
  
  @param n: the number of colors in the palette.
  @param s: the saturation of the colors in the palette.
  @param v: the value component of the colors in the palette.
  @param start: the hue at which the rainbow begins (between 0 and 1).
  @param end: the hue at which the rainbow ends (between 0 and 1).
  @param alpha: the alpha component of the colors in the palette.
docstr_tok: ["Creates","a","rainbow","palette",".","@","param","n",":","the","number","of","colors","in","the","palette",".","@","param","s",":","the","saturation","of","the","colors","in","the","palette",".","@","param","v",":","the","value","component","of","the","colors","in","the","palette",".","@","param","start",":","the","hue","at","which","the","rainbow","begins","(","between","0","and","1",")",".","@","param","end",":","the","hue","at","which","the","rainbow","ends","(","between","0","and","1",")",".","@","param","alpha",":","the","alpha","component","of","the","colors","in","the","palette","."]
code: def __init__(self, n=256, s=1, v=1, start=0, end=1, alpha=1):
      """Creates a rainbow palette.
  
      @param n: the number of colors in the palette.
      @param s: the saturation of the colors in the palette.
      @param v: the value component of the colors in the palette.
      @param start: the hue at which the rainbow begins (between 0 and 1).
      @param end: the hue at which the rainbow ends (between 0 and 1).
      @param alpha: the alpha component of the colors in the palette.
      """
      super().__init__(n)
      self._s = float(clamp(s, 0, 1))
      self._v = float(clamp(v, 0, 1))
      self._alpha = float(clamp(alpha, 0, 1))
      self._start = float(start)
      if end == self._start:
          end += 1
      self._dh = (end - self._start) / n
  
imports: from abc import ABCMeta, abstractmethod
  from math import ceil
label_desc: Use image node_id 1 to create a new RainbowPalette object from inherited base classes: Palette with example: obj = RainbowPalette(n, s, v, start, end, alpha)