Package 'amerika'

Title: American Politics-Inspired Color Palette Generator
Description: A crisp, clean color palette generator inspired by American politics, with colors ranging from blue on the left to gray in the middle and red on the right. A variety of palettes allow for a range of applications from brief discrete scales (e.g., three colors for Democrats, Independents, and Republicans) to continuous interpolated arrays including dozens of shades graded from blue (left) to red (right).
Authors: Philip Waggoner [aut, cre]
Maintainer: Philip D. Waggoner <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2024-11-20 05:19:50 UTC
Source: https://github.com/pdwaggoner/amerika

Help Index


amerika

Description

American politics-inspired color palettes

Details

American politics-inspired color palettes


amerika color palette generator

Description

amerika color palette generator

Usage

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

# 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")

American politics-inspired color palettes

Description

Use amerika_palette to produce desired color palette

Usage

amerika_palettes

Format

An object of class list of length 5.