Learn R Programming

painter (version 0.1.0)

Complement: Generate the complement (opposite hue) of a color, or generate a palette from a color and its complement.

Description

Given a color, Complement() maintains the same value and saturation, but returns a color of the opposite hue. ComplementPalette() creates a color palette that ramps between a color and its complement.

Usage

Complement(color)
ComplementPalette(color,n=100)

Arguments

color

A color or (for Complement) possibly a vector of colors

n

The number of colors to produce

Value

For Complement(), a vector of colors with the same length as color. For ComplementPalette() a vector of n colors

Examples

Run this code
# NOT RUN {
TestPalette(Complement(terrain.colors(100)))
TestPalette(ComplementPalette("blue"))
# }

Run the code above in your browser using DataLab