Added GUI
This commit is contained in:
parent
ae9774cf0d
commit
74df5cb3f0
23 changed files with 3174 additions and 2 deletions
13
utils/colors.py
Normal file
13
utils/colors.py
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue