x2col: Convert numbers or matrices into colors with transparency

Description Usage Arguments

View source: R/colors.R

Description

The name is short for: convert (x) (to) a (col)or with transparency shading. Useful for generating heatmaps.

Usage

1
x2col(x, col = c("#0000ff", "#ff0000"), maxval = 1, bgcol = "#ffffff")

Arguments

x

numeric vector or matrix.

col

vector of two colors in #XXXXXX format. First element determines color associated with negative values. Second element determines color associated with positive values

maxval

numeric. Value for which color reaches saturation.

bgcol

color of background. Colors with full transparency will be replaced with this bg color instead.


tkonopka/shrt documentation built on March 5, 2020, 2:51 p.m.