R/scale_fill_sherlock.R

Defines functions scale_fill_sherlock

Documented in scale_fill_sherlock

#' Sherlock Fill Color Palettes
#'
#' @description
#' Set fill color scheme to one of the Sherlock color palettes
#'
#' @param palette fill color palette to be used (required). options are 1, 2 and 3 (2 and 3 are only one color for no grouping). by default it is set to 1.
#'
#' @return A 'ggplot' color scheme that uses one of the Sherlock color fill palettes
#'
#' @export


scale_fill_sherlock <- function(palette = 1) {

  if(palette == 1) {

    fill_scheme <- ggplot2::scale_fill_manual(values = c("#3971CB", "#D76213", "#111111", "#9A0000",
                                                           "#335F34", "#8E5816", "#624187", "#141B7A",
                                                           "#3971CB", "#D76213", "#111111", "#9A0000",
                                                           "#335F34", "#8E5816", "#624187", "#141B7A",
                                                           "#3971CB", "#D76213", "#111111", "#9A0000",
                                                           "#335F34", "#8E5816", "#624187", "#141B7A",
                                                           "#3971CB", "#D76213", "#111111", "#9A0000",
                                                           "#335F34", "#8E5816", "#624187", "#141B7A",
                                                           "#3971CB", "#D76213", "#111111", "#9A0000",
                                                           "#335F34", "#8E5816", "#624187", "#141B7A",
                                                           "#3971CB", "#D76213", "#111111", "#9A0000",
                                                           "#335F34", "#8E5816", "#624187", "#141B7A",
                                                           "#3971CB", "#D76213", "#111111", "#9A0000",
                                                           "#335F34", "#8E5816", "#624187", "#141B7A",
                                                           "#3971CB", "#D76213", "#111111", "#9A0000",
                                                           "#335F34", "#8E5816", "#624187", "#141B7A",
                                                           "#3971CB", "#D76213", "#111111", "#9A0000",
                                                           "#335F34", "#8E5816", "#624187", "#141B7A",
                                                           "#3971CB", "#D76213", "#111111", "#9A0000",
                                                           "#335F34", "#8E5816", "#624187", "#141B7A",
                                                           "#3971CB", "#D76213", "#111111", "#9A0000",
                                                           "#335F34", "#8E5816", "#624187", "#141B7A",
                                                           "#3971CB", "#D76213", "#111111", "#9A0000",
                                                           "#335F34", "#8E5816", "#624187", "#141B7A",
                                                           "#3971CB", "#D76213", "#111111", "#9A0000",
                                                           "#335F34", "#8E5816", "#624187", "#141B7A",
                                                           "#3971CB", "#D76213", "#111111", "#9A0000",
                                                           "#335F34", "#8E5816", "#624187", "#141B7A",
                                                           "#3971CB", "#D76213", "#111111", "#9A0000",
                                                           "#335F34", "#8E5816", "#624187", "#141B7A",
                                                           "#3971CB", "#D76213", "#111111", "#9A0000",
                                                           "#335F34", "#8E5816", "#624187", "#141B7A"))
  }

  if(palette == 2) {
    fill_scheme <- "#3971CB"
  }

  if(palette == 3) {
    fill_scheme <- "#304269"
  }

  return(fill_scheme)

}
gaboraszabo/sherlock documentation built on Dec. 4, 2024, 12:18 a.m.