Skip to content

Instantly share code, notes, and snippets.

@uribo
Created December 7, 2014 03:41
Show Gist options
  • Save uribo/d5bb4b6f4955435b4806 to your computer and use it in GitHub Desktop.
Save uribo/d5bb4b6f4955435b4806 to your computer and use it in GitHub Desktop.
Generate Dribbble color palette
get_palette <- function (url, col.n = 8) {
url <- html(url)
cols <- url %>%
html_nodes("ul.color-chips li a") %>%
html_attr("title")
cols[1:col.n]
na.omit(cols)
}
# 'usage
# get_palette(url = "https://dribbble.com/shots/1617296-Dribbble-is-5")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment