complementary: Complementary or opposite color

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

View source: R/complementary.R

Description

Complementary or opposite color scheme is formed by colors that are opposite each other on the color wheel (example: red and green). The high contrast of complementary colors creates a vibrant look that must be managed well so it is not jarring.

Usage

1
2
  complementary(color, plot = TRUE, bg = "white",
    labcol = NULL, cex = 0.8, title = TRUE)

Arguments

color

an R color name or color in hexadecimal notation

plot

logical value indicating whether to plot a color wheel with the generated scheme

bg

background color of the plot. Used only when plot=TRUE

labcol

color for the labels (i.e. names of the colors). Used only when plot=TRUE

cex

numeric value indicating the character expansion of the labels

title

logical value indicating whether to display a title in the plot. Used ony when plot=TRUE

Details

The complementary color is obtained following a color wheel with 12 colors, each one spaced at 30 degrees from each other. Complementary color schemes are tricky to use in large doses, but work well when you wnat something to stand out. In addition, omplementary colors are really bad for text.

Value

A character vector with the given color and the complementary color in hexadecimal notation

Author(s)

Gaston Sanchez

See Also

adjacent, splitComp, triadic, tetradic, square

Examples

1
2
3
4
5
# complementary color of 'tomato' with no plot
opposite("tomato", plot = FALSE)

# complementary color of 'tomato' with color wheel
opposite("tomato", bg = "gray30")

Example output

[1] "#FF6347" "#47E3FF"
[1] "#FF6347" "#47E3FF"

colortools documentation built on May 2, 2019, 2:10 p.m.