#' Show colors based on a vector of HEX colors.
#'
#' @param x a vector of HEX colors.
#'
#' @return plot
#' @export
#' @importFrom rlang .data
#' @examples
#' farv_show(c("#d95f02", "#7570b3"))
farv_show <- function(x) {
df <- data.frame(id = seq_along(x))
df %>%
ggplot2::ggplot() +
ggplot2::geom_tile(ggplot2::aes(.data$id, 1, fill = x)) +
ggplot2::scale_fill_identity()
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.