Created
June 23, 2016 17:19
-
-
Save jp26jp/a560720d8cd26ee5a8d3c6ed41376093 to your computer and use it in GitHub Desktop.
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
var colors = {} | |
Cookie.set('main', '#333'); | |
$('#main').spectrum({ | |
color: Cookie.get('main'), // gets the value of the 'main' cookie and sets it as the initial color | |
change: function(color){ | |
colors.main = color.toHexString(); // returns the selected color as a hex string and assigns it to a 'main' property of the colors object | |
Cookie.set('main', colors.main); // updates the value of the 'main' cookie | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment