Created
July 9, 2015 23:49
-
-
Save gartenfeld/4eb6721bdc279bcdebc0 to your computer and use it in GitHub Desktop.
Generating a hue spectrum.
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
| var hue, cell, | |
| grades = 100, | |
| query = ''; | |
| for (var i = 0; i < grades; i++) { | |
| hue = i * 360 / grades | |
| query = '<div style="float:left;' + | |
| 'width:' + (100/grades) + '%;' + | |
| 'height:20px;' + | |
| 'background-color: hsl(' + hue + ', 100%, 75%);"></div>' | |
| cell = $(query) | |
| $('body').append(cell); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment