Last active
December 12, 2015 00:48
-
-
Save nateberkopec/4686470 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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} |
Author
nateberkopec
commented
Jan 31, 2013
Ooo...
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