Created
July 6, 2014 03:39
-
-
Save mikechambers/6a90c4b5c705a1bc43b4 to your computer and use it in GitHub Desktop.
Code to paste into Google Chrome console when viewing color themes on kuler.adobe.com, that will extract the colors into a form that can be easily used in code.
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 getColorName = function () { | |
| return CCweb.models.theme.attributes.name; | |
| }; | |
| var getColors = function () { | |
| return CCweb.models.theme.attributes._hexList; | |
| } | |
| var formatColorsIntoCode = function() { | |
| var colors = getColors(); | |
| var n = getColorName(); | |
| var n = n.replace(/ /g,"_"); | |
| var len = colors.length; | |
| var out = "var " + n.toUpperCase() + " = [\n"; | |
| for(var i = 0; i < len; i++) { | |
| out += "\t\"#" + colors[i] + "\",\n" | |
| } | |
| out = out.slice(0, - 2); | |
| out += "\n];"; | |
| return out; | |
| }; | |
| formatColorsIntoCode(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment