I just picked up image processing in python this past week at the suggestion of a friend to generate patterns of random colors. I found this piece of script online that generates a wide array of different colors across the RGB spectrum.
def random_color():
levels = range(32,256,32)
return tuple(random.choice(levels) for _ in range(3))
I am simply interesting in appending this script to only generate one of three random colors. Preferably red, green, and blue.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…