matrixToColours: matrixToColours

View source: R/A011_matrixToColours.R

matrixToColoursR Documentation

matrixToColours

Description

Takes a matrix converts into rgb colours. e.g. 1=red, 2=blue, etc or ranges for each colour

Usage

matrixToColours(
  image,
  col = c("white", "black", "red", "blue", "orange", "yellow", "green", "purple",
    "brown", "gray"),
  breaks = NULL
)

Arguments

image

a matrix

col

a list of colours or vector that can be coerced into a list using as.list. Each colour should be an rgb vector or character. Lists can contain a mixture of both formats.

breaks

optional. For ranges that correspond to colours

Value

Returns an RGB array

Examples

matrixToColours(matrix(1:9,3))

R-graphic-design/RGD documentation built on Jan. 2, 2023, 10:30 p.m.