def blend_palette(colors, n_colors=6, as_cmap=False):
 name = '-'.join(map(str, colors))
 pal = mpl.colors.LinearSegmentedColormap.from_list(name, colors)
 if (not as_cmap):
  pal = pal(np.linspace(0, 1, n_colors))
 return pal

def blend_palette ( colors , n_colors = 6 , as_cmap = False ) : name = '-' . join ( map ( str , colors ) ) pal = mpl . colors . LinearSegmentedColormap . from_list ( name , colors ) if ( not as_cmap ) : pal = pal ( np . linspace ( 0 , 1 , n_colors ) ) return pal
make a palette that blends between a list of colors .