Learn R Programming

plotwidgets (version 0.5.1)

plotPals: Return all or selected color palettes

Description

Return all or selected color palettes from the plotwidget palette set

Usage

plotPals(pal = NULL, alpha = 1, drop.alpha = TRUE)

Arguments

pal

Name of the palette(s) to return

alpha

Control transparency - set alpha channel to alpha (0 - fully transparent, 1 - fully opaque)

drop.alpha

If true, and if alpha is NULL, the "FF" string of the alpha channel will not be attached to the produced RGB codes

Value

Either a list of palettes, or (if only one palette was selected) a character vector with colors

Details

The plotwidgets package contains a number of predefined palettes, different from those in RColorBrewer.

  • default: a standard, relatively safe (see below) palette

  • safe: safe for color blind persons, based on Wang B. "Points of view: Color blindeness", Nature Methods 8, 441(2011)

  • neon: a bright palette suitable for drawing on dark backgrounds

  • pastel: a dimmed pastel palette

  • haze: very delicate pastel colors

  • dark: same hues as haze, but much darker

  • grey: different shades of grey

  • alphabet: based on "A colour alphabet..." by Paul Green-Armytage

  • few: a palette based on Stephen Few's book

  • zeileis: based on Zeileis et al. 2009

  • vizi: automatically generated palette

List of palettes

You can get all the names of palettes with names(plotPals()), and showcase them with showPalettes(). Furthermore, you can use the pal parameter to plotwidgetGallery to see how this palette looks like with different plot widgets.

See Also

col2rgb.2, rgb2col, hsl2col, col2hsl, modCol, modhueCol, darkenCol, saturateCol

Examples

Run this code
# NOT RUN {
safe <- plotPals("safe") # colorblind-safe palette
plotwidgetGallery(pal=safe)
# }

Run the code above in your browser using DataLab