def set_hls_values(color, h=None, l=None, s=None):
 rgb = mplcol.colorConverter.to_rgb(color)
 vals = list(colorsys.rgb_to_hls(*rgb))
 for (i, val) in enumerate([h, l, s]):
  if (val is not None):
   vals[i] = val
 rgb = colorsys.hls_to_rgb(*vals)
 return rgb

def set_hls_values ( color , h = None , l = None , s = None ) : rgb = mplcol . colorConverter . to_rgb ( color ) vals = list ( colorsys . rgb_to_hls ( * rgb ) ) for ( i , val ) in enumerate ( [ h , l , s ] ) : if ( val is not None ) : vals [ i ] = val rgb = colorsys . hls_to_rgb ( * vals ) return rgb
independently manipulate the h .