divergentColors: Divergent colour palette

divergentColorsR Documentation

Divergent colour palette

Description

Creates a palette for the current session for a divergent-colour graphic with a non-symmetric range. Based on ideas from Maureen Kennedy, Nick Povak, and Alina Cansler.

Usage

divergentColors(
  start.color,
  end.color,
  min.value,
  max.value,
  mid.value = 0,
  mid.color = "white"
)

## S4 method for signature 'character,character,numeric,numeric'
divergentColors(
  start.color,
  end.color,
  min.value,
  max.value,
  mid.value = 0,
  mid.color = "white"
)

Arguments

start.color

Start colour to be passed to colorRampPalette.

end.color

End colour to be passed to colorRampPalette.

min.value

Numeric minimum value corresponding to start.colour. If attempting to change the colour of a RasterLayer, this can be set to minFn(RasterObject).

max.value

Numeric maximum value corresponding to end.colour. If attempting to change the colour of a RasterLayer, this can be set to maxFn(RasterObject).

mid.value

Numeric middle value corresponding to mid.colour. Default is 0.

mid.color

Middle colour to be passed to colorRampPalette. Defaults to "white".

Value

A diverging colour palette.

Author(s)

Eliot McIntire and Alex Chubaty

See Also

colorRampPalette()

Examples

divergentColors("darkred", "darkblue", -10, 10, 0, "white")


PredictiveEcology/quickPlot documentation built on July 8, 2023, 1:29 a.m.