Skip to content

Instantly share code, notes, and snippets.

@lcaballero
Created August 24, 2014 17:45
Show Gist options
  • Save lcaballero/c36f1da0206cf81b1caf to your computer and use it in GitHub Desktop.
Save lcaballero/c36f1da0206cf81b1caf to your computer and use it in GitHub Desktop.
A bit of jquery code to pull rgb colors from Kuler themes.
$("div.content").on("click", function(ev) {
var s = []
var e = $(this)
if (e.is(".content")) {
e.find(".frame > div")
.each(function(i,e) {
var rgb = $(e).css("background-color")
.match(/([0-9]+)/g, ',')
s.push('[', rgb.join(','), ']', '\n')
})
var theme = e.find("ul.assets-item-meta .name > a").text()
console.log('theme', theme)
console.log(s.join(""))
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment