code: def cmap_to_list(colors: str, size: int) -> List[str]:
      """Convert a cmap to a list of specified size"""
      cmap = plt.get_cmap(colors)
      return [rgb2hex(cmap(ix / size)) for ix in range(size)]
  
imports: from typing import List, Callable
  import matplotlib
  import matplotlib.pyplot
  from matplotlib.colors import rgb2hex
label_desc: Use image node_id 1 for calling a global function with example usage: cmap_to_list(colors, size) and returns: unknown