multicolorfits.mix_colors_hex#

multicolorfits.mix_colors_hex(hex_list, colorspace='lab', blend='mean', weights=None)[source]#

Mix solid colors (not images) in a chosen color space.

Useful when designing palettes or predicting how overlapping layer colors will look before loading FITS data.

Parameters:
  • hex_list (list of str) – Hex colors such as ['#FF0000', '#FFFF00'].

  • colorspace (str) – 'lab', 'hsv', or 'hsl' (same semantics as combine_multicolor_colorspace()).

  • blend (str) – Lightness blend: 'mean' (default), 'screen', 'sum', or 'max'.

  • weights (list or None) – Optional per-color weights.

Returns:

str – Mixed color as an uppercase hex string.

Examples

>>> mix_colors_hex(['#FF0000', '#FFFF00'], colorspace='hsv')  
'#FF8800'