R/plot_colours.R

Defines functions plot_colours

Documented in plot_colours

#' Plot colour palette
#'  
#' Function to visualize a colour palette
#'
#' @param cols Vector of colours
#' 
#' @author Shona Wilde
#'
#' @export


plot_colours <- function(cols) {
  
  qplot(
    x = 1:length(cols),
    y = 1, 
    fill = factor(1:length(cols)),
    geom = "tile"
  ) +
    scale_fill_manual(values = cols) +
    theme_void() +
    theme(
      legend.position = "none"
    )
  
} 
shonawilde/shonarrr documentation built on Jan. 29, 2025, 1:27 a.m.