ColToHsv

0th

Percentile

R Color to HSV Conversion

ColToHsv transforms colors from R color into HSV space (hue/saturation/value).

Keywords
color
Usage
ColToHsv(col, alpha = FALSE)
Arguments
col
vector of any of the three kind of R colors, i.e., either a color name (an element of colors()), a hexadecimal string of the form "#rrggbb" or "#rrggbbaa", or an integer i meaning palette()[i]. Non-string values are coerced to integer.

alpha
logical value indicating whether alpha channel (opacity) values should be returned.

Details

Converts a color first into RGB an from there into HSV space by means of the functions rgb2hsv and col2rgb.

Value (brightness) gives the amount of light in the color. Hue describes the dominant wavelength. Saturation is the amount of Hue mixed into the color.

An HSV colorspace is relative to an RGB colorspace, which in R is sRGB, which has an implicit gamma correction.

Value

A matrix with a column for each color. The three rows of the matrix indicate hue, saturation and value and are named "h", "s", and "v" accordingly.

See Also

rgb2hsv, ColToRgb

Aliases
  • ColToHsv
Examples
ColToHsv("peachpuff")
ColToHsv(c(blu = "royalblue", reddish = "tomato")) # names kept

ColToHsv(1:8)
Documentation reproduced from package DescTools, version 0.99.19, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.