viewPalette: view color ramps in a palette preview

View source: R/viewPalette.R

viewPaletteR Documentation

view color ramps in a palette preview

Description

This will create a plot of a color ramp

Usage

viewPalette(col, border = "transparent", name = "")

Arguments

col

the color palette to be visualised

border

color of the segment borders. Defaults to "transparent"

name

an optional name to be put into the plot

Author(s)

Tim Appelhans

Examples

library(colorspace)
library(viridisLite)

clrs <- list(rainbow = rainbow(100),
             rainbow_grey = desaturate(rainbow(100)),
             viridis = viridis(100),
             viridis_grey = desaturate(viridis(100)),
             inferno = inferno(100),
             inferno_grey = desaturate(inferno(100)),
             magma = magma(100),
             magma_grey = desaturate(magma(100)))

out <- lapply(seq(clrs), function(i) {
  viewPalette(clrs[[i]], name = names(clrs)[i])
})

Orcs::latticeCombineGrid(out)


environmentalinformatics-marburg/Rsenal documentation built on July 28, 2023, 6:09 a.m.