Learn R Programming

GSNA (version 0.1.4.2)

contrasting_color: contrasting_color

Description

Function picks colors to contrast with the colors given as the 'col' argument.

Usage

contrasting_color(
  col,
  type = "complement",
  threshold = 127,
  low = "#000000",
  high = "#FFFFFF"
)

Value

A contrasting color.

Arguments

col

A character vector of colors.

type

(optional) Type of contrasting color, i.e. the method of generating the contrasting color. Valid values are 'complement', 'rotate', 'yellow', 'gray', 'binary' and 'blackyellow'.

threshold

(optional, used only for type='binary') The "binary" method works by assessing the mean value of the RGB channels. If the value is above a threshold, the low color is returned, if it is below the threshold, the high color is returned.

low

(optional, used only for type='binary') Low color (see threshold argument).

high

(optional, used only for type='binary') High color (see threshold argument).