bitpal: Get a fun color palette

Description Usage Arguments Value Examples

View source: R/bitpal.R

Description

Color palettes based on Dunkin Donuts, Seinfeld, and Monopoly.

Usage

1
bitpal(pal, n)

Arguments

pal

Name of the color palette ("dunkin", "seinfeld", or "monopoly")

n

Number of colors to return

Value

A character vector of hex codes

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Retrieve some bitpals
bitpal(pal="monopoly", n=7)
bitpal(pal="dunkin", n=4)
bitpal(pal="seinfeld", n=5)
# Use some bitpals
data <- data.frame(product=c("Strawberry spinkle donut", "Iced coffee", "Munchkin", "Boston creme"),
                   points=c(100, 85, 80, 10))
ggplot(data, aes(y=product, x=points, fill=product)) +
  geom_bar(stat="identity") +
  labs(x="Deliciousness points", y="", title="Tracey's opinion of Dunkin products") +
  scale_fill_manual(values=bitpal("dunkin", n=nrow(data)), guide=F) +
  theme_bw()

cfree14/bitpals documentation built on Dec. 19, 2021, 2:57 p.m.