list three ways python can handle colors.
Answers
Answer:
1) Red 2) Green 3) Cyan
Explanation:
Three ways python can handle colors are (1. Red 2. Green 3. Cyan)
Answer: For my clustering gui, I am currently using random colors for the clusters, since I won't know before hand how many clusters I will end up with.
In Python, this looks like:
import random
def randomColor():
return (random.random(),random.random(),random.random())
However, when I update things, the colors change.
So what I would favor is to have a function which has an input argument I such as
def nonrandomColor(i):
...
return color
would always return the same color for the same I, while keeping the ability to generate arbitrarily many colors.
Answer does not have to be formulated in Python, it's more the general layout I'm interested in.