Skip to content

Instantly share code, notes, and snippets.

@rtanglao
Created May 1, 2015 06:12
Show Gist options
  • Save rtanglao/1159f9636d2826374a0f to your computer and use it in GitHub Desktop.
Save rtanglao/1159f9636d2826374a0f to your computer and use it in GitHub Desktop.
rgb to single colour
> tc <-function(x) {
+ return (head(color.id(x),n=1))
+ }
> tc("#fefefe")
[1] "white"
> tc("#fefeff")
[1] "white"
> tc("#fefe00")
[1] "yellow"
> lappy(h$count,tc)
Error: could not find function "lappy"
> lapply(h$count,tc)
[[1]]
[1] "red"
[[2]]
[1] "magenta"
[[3]]
[1] "cyan"
[[4]]
[1] "magenta"
@rtanglao
Copy link
Author

rtanglao commented May 1, 2015

colour_list2 = lapply(topcolour.ig.vancouver.2014$count,tc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment