col2hsv: Color to HSV Conversion

Description Usage Arguments Value Note Examples

Description

Convert R colors to HSV (hue/saturation/value)

Usage

1

Arguments

col

Vector containing any of the three kinds of R color specifications:

  1. a color name (see colors)

  2. a hexadecimal string of the form "#rrggbb" (see rgb)

  3. a positive integer i meaning palette()[i]

Value

A matrix with a column for each color. The three rows of the matrix indicate hue ("h"), saturation ("s"), and value ("v"), which is also referred to as brightness).

Note

The alpha channel is stripped from hexadecimal strings where one is included

Examples

1
2
3
4
5
# Get HSV coordinates for red
col2hsv("red")

# Get HSV coordinates for several different colors
col2hsv(c("#FF0000", "mediumpurple3", 2, "steelblue4"))

briandconnelly/colormod documentation built on May 13, 2019, 5:13 a.m.