class_docstr: A wrapper for functionality surrounding a list of colors, including a
  context manager that allows the palette to be set with a with statement.
class_docstr_tok: ["A","wrapper","for","functionality","surrounding","a","list","of","colors",",","including","a","context","manager","that","allows","the","palette","to","be","set","with","a","with","statement","."]
docstr: Can initialize the ColorPalette with either a name or a list.
  
  Parameters
  ----------
  
  name_or_list :
      specify a palette name or a list of RGB or Hex values
docstr_tok: ["Can","initialize","the","ColorPalette","with","either","a","name","or","a","list",".","Parameters","--","--","--","--","--","name_or_list",":","specify","a","palette","name","or","a","list","of","RGB","or","Hex","values"]
code: def __init__(self, name_or_list):
      """
      Can initialize the ColorPalette with either a name or a list.
  
      Parameters
      ----------
  
      name_or_list :
          specify a palette name or a list of RGB or Hex values
  
      """
      if isinstance(name_or_list, str):
          if name_or_list not in PALETTES:
              raise YellowbrickValueError(
                  "'{}' is not a recognized palette!".format(
                      name_or_list
                  )
              )
  
          name_or_list = PALETTES[name_or_list]
  
      super(ColorPalette, self).__init__(name_or_list)
  
file_path: yellowbrick/yellowbrick/style/palettes.py
imports: import numpy
  import matplotlib
  import matplotlib.pyplot
  import matplotlib.colors
  from itertools import cycle
  from .colors import get_color_cycle
  from yellowbrick.exceptions import YellowbrickValueError
label_desc: Use image node_id 1 to create a new ColorPalette object from inherited base classes: list with example: obj = ColorPalette(name_or_list)