Learn R Programming

GSNA (version 0.1.4.2)

combineRGBMatrices: combineRGBMatrices

Description

Given 2 different matrices of colors, combine the colors numerically. This is used in makeTwoColorEncodeFunction().

Usage

combineRGBMatrices(
  c1.mat,
  c2.mat,
  combine_method = "scaled_geomean",
  max_per_channel = 255
)

Value

A 3-column RGB matrix of combined colors.

Arguments

c1.mat

A numeric matrix with three columns corresponding to red, green, blue, with numerical values ranging from 0 to 255 to be combined numerically with c2.mat.

c2.mat

A numeric matrix with three columns corresponding to red, green, blue, with numerical values ranging from 0 to 255 to be combined numerically with c1.mat.

combine_method

Method of combining colors, can be 'scaled_geomean', 'standard'/'euclidean', 'negative_euclidean', 'mean', 'scaled_geomean' (default = 'scaled_geomean')

max_per_channel

Maximal color value per RGB channel (default 255).

See Also

makeTwoColorEncodeFunction()

Examples

Run this code

c1.mat <- matrix( c(255, 100, 0 ), ncol = 3 )
c2.mat <- matrix( c( 0, 50, 255 ), ncol = 3 )
c12.mat <- combineRGBMatrices( c1.mat, c2.mat, "euclidean" )

Run the code above in your browser using DataLab