Skip to content

Instantly share code, notes, and snippets.

@nateberkopec
Last active December 12, 2015 00:48
Show Gist options
  • Save nateberkopec/4686470 to your computer and use it in GitHub Desktop.
Save nateberkopec/4686470 to your computer and use it in GitHub Desktop.
number_of_colors = 60 #number of colors you want to generate in total.
z = 12 #"set size"
ang = 180/(z)
s = 30 #desired saturation constant, 1 to 100
v = 50 #desired value/lightness constant, 1 to 100
complement = (0..z/2).map{|i| (0..180).step(ang).map{|h| [[h + i,s,v], [h + i + 180,s,v] }}
triad = (0..z/2).map{|i| (0..180).step(ang).map{|h| [[h + i,s,v], [h + i + 60,s,v], [h + i + 120,s,v]] }}
tetrad = (0..z/2).map{|i| (0..180).step(ang).map{|h| [[h + i,s,v], [h + i + 30,s,v], [h + i + 180,s,v], [h + i + 210,s,v] ] }.shuffle}
@nateberkopec
Copy link
Author

http://i.imgur.com/IWoWMnz.png

@revivek
Copy link

revivek commented Jan 31, 2013

Ooo...

@thebyrd
Copy link

thebyrd commented Jan 31, 2013

O, sorry I didn't understand the question

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment