code: def categorical_cmap(color, nsc):
      # ccolors = plt.get_cmap(cmap)(np.arange(nc, dtype=int))
      # print(ccolors[0:4])
      cols = np.zeros((nsc, 3))
      # chsv = mc.rgb_to_hsv(c[:3])
      chsv = mc.rgb_to_hsv(mc.hex2color(color))
      arhsv = np.tile(chsv, nsc).reshape(nsc, 3)
      arhsv[:, 1] = np.linspace(chsv[1], 0.25, nsc)
      arhsv[:, 2] = np.linspace(chsv[2], 1, nsc)
      rgb = mc.hsv_to_rgb(arhsv)
      cols[0:nsc, :] = rgb
      cmap = mc.ListedColormap(cols)
      return cmap
  
imports: import numpy
  import matplotlib.pyplot
  import matplotlib.colors
label_desc: Use image node_id 1 for calling a global function with example usage: categorical_cmap(color, nsc) and returns: cmap