code: def cmap(rgbin, N=256):
      '''Input an array of rgb values to generate a colormap.
  
      :param rgbin: An [mx3] array, where m is the number of input color triplets which
           are interpolated between to make the colormap that is returned. hex values
           can be input instead, as [mx1] in single quotes with a #.
      :param N=10: The number of levels to be interpolated to.
  
      '''
  
      # rgb inputs here
      if not isinstance(rgbin[0], _string_types):
          # normalize to be out of 1 if out of 256 instead
          if rgbin.max() > 1:
              rgbin = rgbin/256.
  
      cmap = mpl.colors.LinearSegmentedColormap.from_list('mycmap', rgbin, N=N)
  
      return cmaf cmap(rgbin, N=256):
      '''Input an array of rgb values to generate a colormap.
  
      :param rgbin: An [mx3] array, where m is the number of input color triplets which
           are interpolated between to make the colormap that is returned. hex values
           can be input instead, as [mx1] in single quotes with a #.
      :param N=10: The number of levels to be interpolated to.
  
      '''
  
      # rgb inputs here
      if not isinstance(rgbin[0], _string_types):
          # normalize to be out of 1 if out of 256 instead
          if rgbin.max() > 1:
              rgbin = rgbin/256.
  
      cmap = mpl.colors.LinearSegmentedColormap.from_list('mycmap', rgbin, N=N)
  
      return cmap
docs: Input an array of rgb values to generate a colormap.
  
      :param rgbin: An [mx3] array, where m is the number of input color triplets which
           are interpolated between to make the colormap that is returned. hex values
           can be input instead, as [mx1] in single quotes with a #.
      :param N=10: The number of levels to be interpolated to.