intensity.colors {Cardinal} | R Documentation

## Color palettes for imaging

### Description

Create a vector of `n` continuous or discrete colors.

### Usage

    color.map(map = c("redblack", "greenblack", "blueblack",
        "viridis", "cividis", "magma", "inferno", "plasma",
        "rainbow", "darkrainbow", "grayscale",
        "jet", "hot", "cool"), n = 100)

    col.map(...)

    intensity.colors(n = 100, alpha = 1)

    jet.colors(n = 100, alpha = 1)

    divergent.colors(n = 100, start = "#00AAEE",
        middle = "#FFFFFF", end = "#EE2200", alpha = 1)

    risk.colors(n = 100, alpha = 1)

    gradient.colors(n = 100, start = "#000000",
        end = "#00AAFF", alpha = 1)

    bw.colors(n = 100, alpha = 1)

    discrete.colors(n = 2, chroma = 150, luminance = 65, alpha = 1)

    alpha.colors(col, n = 100,
        alpha = (seq_len(n)/n)^alpha.power,
        alpha.power = 2)

    darkmode()

    lightmode()

### Arguments

`map` | the name of the colormap
`n` | the number of colors
`...` | arguments passed to `color.map()`
`alpha` | a vector of alpha values between 0 and 1
`start` | the start color value
`middle` | the middle color value
`end` | the end color value
`chroma` | the chroma of the color
`luminance` | the luminance of the color
`col` | the color(s) to expand with transparency
`alpha.power` | how the alpha should ramp as it increases

### Details

Most of these functions return a vector of colors.

Several of the options made available by `color.map` are borrowed from the `viridisLite` package, including 'viridis', 'cividis', 'magma', 'inferno', and 'plasma'. The original functions for these color palettes are also re-exported for use by users. See the documention for them in that package.

The `darkmode` and `lightmode` functions change the graphical parameters for the current graphics device accordingly. The new themes will be used for any subsequent plots.

### Value

A palette of colors.

### Author(s)

Kylie A. Bemis

### See Also

`viridis`, `cividis`, `magma`, `inferno`, `plasma`

### Examples

    col <- gradient.colors(100^2)
    if ( interactive() )
    	image(matrix(1:(100^2), nrow=100), col=col)

[Package Cardinal version 2.4.0 Index]