Added GUI

This commit is contained in:
apenzko 2021-10-17 12:49:49 +02:00
parent ae9774cf0d
commit 74df5cb3f0
23 changed files with 3174 additions and 2 deletions

13
utils/colors.py Normal file
View file

@ -0,0 +1,13 @@
import colorsys
def random_colors(N, bright=True):
"""
Generate random colors.
To get visually distinct colors, generate them in HSV space then
convert to RGB.
"""
brightness = 1.0 if bright else 0.7
hsv = [(i / N, 1, brightness) for i in range(N)]
colors = list(map(lambda c: colorsys.hsv_to_rgb(*c), hsv))
return colors