amerika_palette: amerika color palette generator

Description Usage Arguments Value References Examples

View source: R/amerika_colors.R

Description

amerika color palette generator

Usage

1
amerika_palette("name", n, "type")

Arguments

name

Name of the specific palette in quotation marks. The options are: Republican, Democrat, Dem_Ind_Rep3, Dem_Ind_Rep5, Dem_Ind_Rep7

n

Number of colors to select from the palette. If null, then all colors in the palette are selected

type

Specify the type of color mapping, either "continuous" or "discrete" in quotation marks. Use "continuous" to include more colors than those in the palette. See examples below for more @importFrom graphics rgb rect par image text

Value

A vector of colors

References

Karthik Ram and Hadley Wickham. 2015. wesanderson: a Wes Anderson palette generator. R package version 0.3.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Display each palette
amerika_palette("Republican")
amerika_palette("Democrat")
amerika_palette("Dem_Ind_Rep3")
amerika_palette("Dem_Ind_Rep5")
amerika_palette("Dem_Ind_Rep7")

# Interpolating between existing colors based on the palettes using the "continuous" type
amerika_palette(50, name = "Republican", type = "continuous")
amerika_palette(50, name = "Democrat", type = "continuous")
amerika_palette(50, name = "Dem_Ind_Rep3", type = "continuous")
amerika_palette(50, name = "Dem_Ind_Rep5", type = "continuous")
amerika_palette(50, name = "Dem_Ind_Rep7", type = "continuous")

amerika documentation built on May 6, 2019, 1:10 a.m.