Learn R Programming

tricolore (version 1.0.3)

ColorMap: RGB Mixture of Ternary Composition

Description

Return the ternary balance scheme colors for a matrix of ternary compositions.

Usage

ColorMap(P, breaks, h_, c_, l_, contrast, center, spread)

Arguments

P

n by 3 matrix of ternary compositions p1, p2, p3_i for i=1, ..., n.

breaks

Number of breaks in the discrete color scale. An integer >0. Values above 99 imply no discretization.

h_

Primary hue of the first ternary element in angular degrees [0, 360].

c_

Maximum possible chroma of mixed colors [0, 200].

l_

Lightness of mixed colors [0, 100].

contrast

Lightness contrast of the color scale [0, 1).

center

Ternary coordinates of the grey-point.

spread

Spread of the color scale around center > 0.

Value

An n row data frame giving, for each row of the input P, the input proportions (p1, p2, p3), parameters of the color mixture (h, c, l) and the hexsrgb string of the mixed colors.

Examples

Run this code
# NOT RUN {
P <- prop.table(matrix(runif(9), ncol = 3), 1)
tricolore:::ColorMap(P, breaks = 5, h_ = 80, c_ = 170, l_ = 80,
                     contrast = 0.6, center = rep(1/3, 3), spread = 1)

# }

Run the code above in your browser using DataLab