Function picks colors to contrast with the colors given as the 'col'
argument.
contrasting_color(
col,
type = "complement",
threshold = 127,
low = "#000000",
high = "#FFFFFF"
)
A contrasting color.
A character vector of colors.
(optional) Type of contrasting color, i.e. the method of generating the contrasting color.
Valid values are 'complement'
, 'rotate'
, 'yellow'
, 'gray'
, 'binary'
and 'blackyellow'
.
(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.
(optional, used only for type='binary'
) Low color (see threshold
argument).
(optional, used only for type='binary'
) High color (see threshold
argument).