tacco.plots.mix_base_colors

mix_base_colors(weights, base_colors_rgb, mode='xyv')[source]

Mix colors “additively”. In contrast to weighted averages over “rgb” values (which results in quite dark colors), the average can be done in “xyv” space, which is “hsv” with the “hs” part converted from polar to cartesian coordinates.

Parameters:
  • weights – A weight tensor with last dimension n_base describing mixtures of n_base colors; this can be a ndarray or a DataFrame.

  • base_colors_rgb – An n_base X 3 matrix defining the base colors in rgb space; this must be a ndarray.

  • mode

    The mixing mode; available are:

    • ’rgb’: average the rgb values in the rgb cube

    • ’xyv’: average the xyz values in the hsv cylider

Returns:

Returns the color mixtures depending on the type of weights either as ndarray or DataFrame.