R/read_palette.R

Defines functions read_palette

Documented in read_palette

#' Function reads a color palette and returns a vector of hexadecimal strings.
#'
#' @description The function reads a readable .rds file created by
#'  \code{RpalettePkg::create_palette()} and returns a list of hexadecimal strings
#'  suitable for ggplot2 applications.
#'
#' @param palette_path A string that sets the file path for the .rds file to read. The
#'   file stores a vector of colors in hexidecimal format.
#'
#' @return Function returns a vector of colors valued as hexadecimal strings.
#'
#' @author Rick Dean
#'
#' @export
read_palette <- function(palette_path = NULL){
  palette_vec = readRDS(palette_path)
  return(palette_vec)
}
deandevl/RpalettePkg documentation built on Sept. 19, 2021, 8:45 a.m.