display_colors#

cosmicjellyfish.analysis.fishconsumer.display_colors(colors, figsize=(6, 6))[source]#

Display a pie chart of colors with their names and hex codes.

This function creates a visual representation of a color palette by generating a pie chart where each slice represents a color. Each color is labeled with its name and hex code. The labels are positioned around the pie chart for clear visibility.

Parameters:
  • colors (list of tuples) – A list of tuples containing the name and hex code for each color. Each tuple should be in the format (name, hex_code), where name is a string and hex_code is a string representing a valid hex color (e.g., “#FF0000”).

  • figsize (tuple, optional) – The figure size in inches as (width, height). Defaults to (6, 6).

Returns:

The function displays the pie chart but does not return any value.

Return type:

None

Example

>>> colors = [("Red", "#FF0000"), ("Green", "#00FF00"), ("Blue", "#0000FF")]
>>> display_colors(colors)