# Define Base Colors
# Colors from UNHCR dataviz guidelines
unhcrcolors <- list(
blue = "#0072BC",
white = "#FFFFFF",
black = "#000000",
yellow = "#FAEB00",
grey = "#666666",
navy = "#18375F",
green = "#00B398",
red = "#EF4A60",
lightblue = "#DCE9FF",
mediumblue = "#8EBEFF",
darkblue = "#044F85",
lightgrey = "#E6E6E6",
mediumgrey = "#CCCCCC",
darkgrey = "#222222",
lightyellow = "#FFF9CB",
mediumyellow = "#FFF483",
darkyellow = "#E1CC0D"
)
# Generate color_variables.css
css_colors <- paste0(" --unhcr-", names(unhcrcolors), ": ", unname(unlist(unhcrcolors)), ";")
warning <- "/*! This file is autogenerated in data-raw/colors.R Do not manually edit */"
fileConn <- file("inst/resources/css/color_variables.css")
writeLines(c(warning, ":root {", css_colors, "}"), fileConn)
close(fileConn)
# Generate SCSS variables
scss_colors <- paste0("$unhcr-", names(unhcrcolors), ": ", unname(unlist(unhcrcolors)), ";")
warning <- "// This file is autogenerated in data-raw/colors.R. Do not manually edit"
fileConn <- file("data-raw/scss/_colors.scss")
writeLines(c(warning, scss_colors), fileConn)
close(fileConn)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.