Created
September 5, 2016 09:47
-
-
Save fpom/a8a0b696bedb4d7d05186b20cf3b211d to your computer and use it in GitHub Desktop.
Generate distinct colors as RGB triples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import colorsys | |
def make_colors (num): | |
"Generate num disting colors as RGB triples" | |
for i in np.arange(0.0, 360.0, 360.0/num): | |
yield colorsys.hls_to_rgb(i/360.0, 0.7, 0.9) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment