Package 'mexicolors'

Title: Mexican Politics-Inspired Color Palette Generator
Description: A color palette generator inspired by Mexican politics, with colors ranging from red on the left to gray in the middle and green on the right. Palette options range from only a few colors to several colors, but with discrete and continuous options to offer greatest flexibility to the user. This package allows for a range of applications, from mapping brief discrete scales (e.g., four colors for Morena, PRI, and PAN) to continuous interpolated arrays including dozens of shades graded from red to green.
Authors: Alejandro Platas-Lopez [aut, cre]
Maintainer: Alejandro Platas-Lopez <[email protected]>
License: GPL (>= 2)
Version: 0.3.0
Built: 2025-02-28 05:31:48 UTC
Source: https://github.com/alexplatasl/mexicolors

Help Index


Mexico color palette generator

Description

Mexico color palette generator

Usage

mexico_palette("name", n, "type")

Arguments

name

Name of the specific palette in quotation marks. The options are: morena, pri, pan, prd, cuatroT

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

Philip Waggoner. 2019. amerika: American Politics-Inspired Color Palette Generator. R package version 0.1.0

Examples

# Display each palette
mexico_palette("morena")
mexico_palette("pri")
mexico_palette("pan")
mexico_palette("prd")
mexico_palette("cuatroT")

# Interpolating between existing colors based on the palettes using the "continuous" type
mexico_palette(50, name = "morena", type = "continuous")
mexico_palette(50, name = "pri", type = "continuous")
mexico_palette(50, name = "pan", type = "continuous")
mexico_palette(50, name = "prd", type = "continuous")
mexico_palette(50, name = "cuatroT", type = "continuous")

Mexican politics-inspired color palettes

Description

Use mexico_palette to produce desired color palette

Usage

mexico_palettes

Format

An object of class list of length 8.


mexicolors

Description

Mexican politics-inspired color palettes

Details

Mexican politics-inspired color palettes