def pastel(colour, weight=2.4):
 rgb = np.asarray(mcolors.to_rgba(colour)[:3])
 maxc = max(rgb)
 if ((maxc < 1.0) and (maxc > 0)):
  scale = (1.0 / maxc)
  rgb = (rgb * scale)
 total = rgb.sum()
 slack = 0
 for x in rgb:
  slack += (1.0 - x)
 x = ((weight - total) / slack)
 rgb = [(c + (x * (1.0 - c))) for c in rgb]
 return rgb

def pastel ( colour , weight = 2.4 ) : rgb = np . asarray ( mcolors . to_rgba ( colour ) [ : 3 ] ) maxc = max ( rgb ) if ( ( maxc < 1.0 ) and ( maxc > 0 ) ) : scale = ( 1.0 / maxc ) rgb = ( rgb * scale ) total = rgb . sum ( ) slack = 0 for x in rgb : slack += ( 1.0 - x ) x = ( ( weight - total ) / slack ) rgb = [ ( c + ( x * ( 1.0 - c ) ) ) for c in rgb ] return rgb
convert colour into a nice pastel shade .