friendly_pal: A color blind friendly color palette generator

View source: R/colors.R

friendly_palR Documentation

A color blind friendly color palette generator

Description

Code is based on the wes anderson package https://github.com/karthik/wesanderson These are a handful of color palettes that are color blind friendly.

Usage

friendly_pal(name, n, type = c("discrete", "continuous"))

Arguments

name

Name of desired palette. Choices are: bright_seven, contrast_three, vibrant_seven, muted_nine, nickel_five, ito_eight

n

Number of colors desired.

type

Either "continuous" or "discrete". Use continuous if you want to automatically interpolate between colours. @importFrom graphics rgb rect par image text

Value

A vector of colours.

Examples

friendly_pal("bright_seven")
friendly_pal("contrast_three")
friendly_pal("vibrant_seven")
friendly_pal("vibrant_seven", 3)

# If you need more colours than normally found in a palette, you
# can use a continuous palette to interpolate between existing
# colours
pal <- friendly_pal(21, name = "muted_nine", type = "continuous")
image(volcano, col = pal)

JLSteenwyk/ggpubfigs documentation built on Dec. 9, 2024, 10:29 a.m.