Skip to content

Instantly share code, notes, and snippets.

@fpom
Created September 5, 2016 09:47
Show Gist options
  • Save fpom/a8a0b696bedb4d7d05186b20cf3b211d to your computer and use it in GitHub Desktop.
Save fpom/a8a0b696bedb4d7d05186b20cf3b211d to your computer and use it in GitHub Desktop.
Generate distinct colors as RGB triples
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