blueWhiteRed: Blue-white-red color sequence

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/Functions.R

Description

Generate a blue-white-red color sequence of a given length.

Usage

1
blueWhiteRed(n, gamma = 1, endSaturation = 1)

Arguments

n

number of colors to be returned.

gamma

color change power.

endSaturation

a number between 0 and 1 giving the saturation of the colors that will represent the ends of the scale. Lower numbers mean less saturation (lighter colors).

Details

The function returns a color vector that starts with blue, gradually turns into white and then to red. The power gamma can be used to control the behaviour of the quarter- and three quarter-values (between blue and white, and white and red, respectively). Higher powers will make the mid-colors more white, while lower powers will make the colors more saturated, respectively.

Value

A vector of colors of length n.

Author(s)

Peter Langfelder

See Also

numbers2colors for a function that produces a color representation for continuous numbers.

Examples

1
2
3
4
5
6
7
  par(mfrow = c(3, 1))
  displayColors(blueWhiteRed(50));
  title("gamma = 1")
  displayColors(blueWhiteRed(50, 3));
  title("gamma = 3")
  displayColors(blueWhiteRed(50, 0.5));
  title("gamma = 0.5")

nosarcasm/WGCNA documentation built on May 28, 2019, 1:01 p.m.