admin_color_tools/theme_rendering.R

library(tidyverse)

raw <- readxl::read_xlsx("admin_color_tools/color_themes.xlsx")

themes <- raw[, 1:(which(grepl("..", names(raw), fixed = T))[1]-1)]

color_key <- brickr::lego_colors 

brickr_themes <- themes %>% 
  filter(!is.na(TYPE)) %>% 
  mutate(index = row_number() - 2) %>% 
  gather(theme, brickrID, -TYPE, -index) %>% 
  filter(!is.na(brickrID)) %>% 
  inner_join(color_key %>% select(brickrID, hex)) %>% 
  select(-brickrID)

usethis::use_data(brickr_themes, overwrite = T)
ryantimpe/brickr documentation built on Jan. 15, 2024, 10:29 p.m.