Learn R Programming

palettes (version 0.2.2)

colour-mixing-arithmetic: Mix colour vectors with arithmetic operators

Description

These binary operators mix colour vectors with arithmetic operators.

Usage

# S3 method for palettes_colour
+(e1, e2)

Value

The binary operators return colour vectors of class palettes_colour containing the result of the element by element operations. If involving a zero-length vector the result has length zero. Otherwise, the elements of shorter vectors are recycled as necessary. The + operator is for additive colour mixing.

Arguments

e1, e2

Colour vectors of class palettes_colour.

Examples

Run this code
x <- pal_colour("red")
y <- pal_colour("blue")
x + y

Run the code above in your browser using DataLab