ColorRgbFun {colorpatch}R Documentation

Creates a color mapping function

Description

Creates a color mapping function

Usage

ColorRgbFun(pal, xmin = -1, xmax = 1, coerce.fun = colorspace::hex)

Arguments

pal

the color palette

xmin

minimum value to be mapped to the first entry of the palette

xmax

maximum value to be mapped to the last entry of the palette

coerce.fun

the color coercing function (e.g. for ggplot2 colorspace::hex() is recommended)

Value

a function mapping a value to a color

Examples

data("OptimGreenRedLAB")
fn <- ColorRgbFun(OptimGreenRedLAB)

[Package colorpatch version 0.1.2 Index]