class_docstr: A palette that returns colors from a pre-calculated list of colors
class_docstr_tok: ["A","palette","that","returns","colors","from","a","pre-calculated","list","of","colors"]
docstr: Creates the palette backed by the given list. The list must contain
  RGBA quadruplets or color names, which will be resolved first by
  L{color_name_to_rgba()}. Anything that is understood by
  L{color_name_to_rgba()} is OK here.
docstr_tok: ["Creates","the","palette","backed","by","the","given","list",".","The","list","must","contain","RGBA","quadruplets","or","color","names",",","which","will","be","resolved","first","by","L","{","color_name_to_rgba","(",")","}",".","Anything","that","is","understood","by","L","{","color_name_to_rgba","(",")","}","is","OK","here","."]
code: def __init__(self, items):
      """Creates the palette backed by the given list. The list must contain
      RGBA quadruplets or color names, which will be resolved first by
      L{color_name_to_rgba()}. Anything that is understood by
      L{color_name_to_rgba()} is OK here."""
      super().__init__(len(items))
      for idx, color in enumerate(items):
          if isinstance(color, str):
              color = color_name_to_rgba(color)
          self._cache[idx] = color
  
imports: from abc import ABCMeta, abstractmethod
  from math import ceil
label_desc: Use image node_id 1 to create a new PrecalculatedPalette object from inherited base classes: Palette with example: obj = PrecalculatedPalette(items)