Last active
July 29, 2026 23:22
-
-
Save benjamin-chan/765d925783868cc68260ce296795fd97 to your computer and use it in GitHub Desktop.
Oregon Health Authority color palette for R
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pal <- c("#003e75", # OHA blue (updated) | |
| "#ec5a24", # OHA orange | |
| "#00817f", # Sea glass | |
| "#752e71", # Beauty berry | |
| "#7a7b72", # Cloudy day | |
| "#cc1f4d", # Cranberry | |
| "#004e00", # Pine | |
| "#d5dae7", # OHA blue tint | |
| "#fff2dd", # OHA orange tint | |
| "#dceae8", # Sea glass tint | |
| "#ebdee8", # Beauty berry tint | |
| "#f2f2f2", # Light gray tint (HPA) | |
| "#000000") # Black | |
| # EXAMPLE | |
| # devtools::source_gist("https://gist.github.com/benjamin-chan/765d925783868cc68260ce296795fd97") | |
| # devtools::source_url("https://gist.github.com/benjamin-chan/765d925783868cc68260ce296795fd97/raw/OHA_palette.R") | |
| # pal | |
| # palette <- c("Main\ncolors", "Extended colors\nfor charts\nand graphs", "Backgrounds\nand tints", "Text") | |
| # df <- expand.grid(palette = palette, seq = LETTERS[1:5], id = seq(1, 50)) | |
| # df <- cbind(df, x = rnorm(nrow(df)), y = rnorm(nrow(df))) | |
| # df$color <- factor((unclass(df$palette) - 1) * nlevels(df$seq) + unclass(df$seq)) | |
| # labels <- data.frame(df[c(1:7, 9:11, 13, 15, 19), c("palette", "seq")] |> unique() |> dplyr::arrange(palette, seq), | |
| # code = pal) | |
| # library(ggplot2) | |
| # library(extrafont) | |
| # extrafont::font_import(prompt = FALSE) | |
| # loadfonts(device = "win") | |
| # ggplot(df) + | |
| # geom_density(aes(x = x, color = color, fill = color)) + | |
| # geom_text(data = labels, aes(label = code), x = 0, y = Inf, vjust = 1, family = "Noto Sans") + | |
| # scale_color_manual(values = c(pal[1:4], "white", | |
| # pal[5:7], "white", "white", | |
| # pal[1:5], | |
| # pal[13], "white", "white", "white", "white")) + | |
| # scale_fill_manual(values = c(pal[1:4], "white", | |
| # pal[5:7], "white", "white", | |
| # pal[8:12], | |
| # pal[13], "white", "white", "white", "white")) + | |
| # facet_grid(palette ~ seq, switch = "y") + | |
| # theme_void() + | |
| # theme(legend.position = "none", | |
| # strip.text.x = element_blank(), | |
| # strip.text.y = element_text(hjust = 1/2), | |
| # text = element_text(family = "Noto Sans")) | |
| # ggsave("OHA_palette1.png", bg = "white", dpi = 300, height = 5, width = 7, units = "in") | |
| # ggplot(df) + | |
| # geom_point(aes(x = x, y = y, color = color, fill = color), shape = 21) + | |
| # geom_text(data = labels, aes(label = code), x = 0, y = Inf, vjust = 1, family = "Noto Sans") + | |
| # scale_color_manual(values = c(pal[1:4], "white", | |
| # pal[5:7], "white", "white", | |
| # pal[1:5], | |
| # pal[13], "white", "white", "white", "white")) + | |
| # scale_fill_manual(values = c(pal[1:4], "white", | |
| # pal[5:7], "white", "white", | |
| # pal[8:12], | |
| # pal[13], "white", "white", "white", "white")) + | |
| # facet_grid(palette ~ seq, switch = "y") + | |
| # theme_void() + | |
| # theme(legend.position = "none", | |
| # strip.text.x = element_blank(), | |
| # strip.text.y = element_text(hjust = 1/2), | |
| # text = element_text(family = "Noto Sans")) | |
| # ggsave("OHA_palette2.png", bg = "white", dpi = 300, height = 5, width = 7, units = "in") | |
| # SOURCES | |
| # https://sharedsystems.dhsoha.state.or.us/DHSForms/Served/le2022.pdf |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sample 1
Sample 2