rgb2hsv
Hue, Saturation, Value Color Model

Description

Converts from red, green, and blue color parameterization to hue, saturation, and value parameterization.

Usage

rgb2hsv(r, g = NULL, b = NULL, maxColorValue = 255)

Arguments

r either a numeric vector of red values or a 3-row matrix of red, green, and blue values. The values should be between 0 and maxColorValue.
g a numeric vector of green values between 0 and maxColorValue. If omitted or NULL, then r must be a 3-row matrix.
b a numeric vector of blue values between 0 and maxColorValue. If omitted or NULL, then r must be a 3-row matrix.
maxColorValue a numeric value giving the scale of the color values. All color values must be between 0 and maxColorValue.
Value
returns a 3-row by length(r) column (or ncol(r) if r is a matrix) numeric matrix giving the HSV parameters for the input colors.
See Also
hsv, col2rgb
Examples
rgb2hsv(col2rgb(c(Danger="red", Caution="yellow", Normal="green")))
Package grDevices version 6.1.4-13
Package Index