knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

bojackpalette

The goal of bojackpalette is to provide clean and coordinated color palettes inspired by characters and scenes from Bojack Horseman.

Installation

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("mwhalen18/bojackpalette")

Some palettes are generated from various stills from the show.

knitr::include_graphics("https://preview.redd.it/ycx96npd88351.png?width=960&crop=smart&auto=webp&s=4608831416972e77fb3fbdb5ba083dd40085df2a")
knitr::include_graphics("https://wallpapercave.com/wp/wp2084607.jpg")

Example

There are currently r length(bojackpalette::bojack_palettes) total palettes to choose from.

library(bojackpalette)

names(bojack_palettes)

You can create a palette using the following command:

palette = bojack_palette("Bojack")

You can also specify a specific number of colors from the palette.

bojack_palette("SarahLynn", 5)

Palettes

print.palette = function(x, ...){
  n = length(x)
  old = par(mar = c(0.5,0.5,0.5,0.5))
  on.exit(par(old))
  image(1:n, 1, as.matrix(1:n), col = x,
        ylab = "", xaxt = "n", yaxt = "n", bty = "n")

  rect(0, 0.9, n + 1, 1.1, col = rgb(1, 1, 1, 0.8), border = NA)
  text((n + 1) / 2, 1, labels = attr(x, "name"), cex = 1, family = "Helvetica", col = "#32373D")
}

for(name in names(bojack_palettes)){
  (print.palette(bojack_palette(name)))
}


mwhalen18/bojackpalette documentation built on Dec. 21, 2021, 11:05 p.m.