random_colors¶

random_colors(num_colors, *, bright)[source]¶

Generate a number of random colors.

To get visually distinct colors, generate them in HSV space then convert to RGB.

Parameters:
  • num_colors (int) – Number of perceptively different colors to generate.

  • bright (bool) – To use bright color or not.

Returns:

Array of (r, g, b) colors.

Return type:

np.ndarray