Type: | Package |
Title: | American Politics-Inspired Color Palette Generator |
Version: | 0.1.1 |
Maintainer: | Philip Waggoner <philip.waggoner@gmail.com> |
BugReports: | https://github.com/pdwaggoner/amerika/issues |
Description: | A 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). This package greatly benefitted from building on the source code (with permission) from Ram and Wickham (2015). |
License: | MIT + file LICENSE |
Encoding: | UTF-8 |
RoxygenNote: | 6.1.1 |
NeedsCompilation: | no |
Packaged: | 2025-04-29 17:13:21 UTC; philipwaggoner |
Author: | Philip Waggoner |
Repository: | CRAN |
Date/Publication: | 2025-04-29 17:40:11 UTC |
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: |
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 |
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.