hsv()
function in R Language is used to create a vector of colors from vectors specifying hue, saturation and value.
Syntax: hsv(h, s, v)
Parameters:
h, s, v: numeric vectors of values in the range [0, 1] for ‘hue’, ‘saturation’ and ‘value’ to be combined to form a vector of colors.
Example 1:
# R program to illustrate # hsv function # Calling the hsv() function hsv( 0 , 0 , 0 )
hsv( 1 , 1 , 1 )
|
Output:
[1] "#000000" [1] "#FF0000"
Example 2:
# R program to illustrate # hsv function # Calling the hsv() function hsv( 0.1 , 0.3 , 0.5 )
hsv( 1 , 0.08 , 0.245 )
|
Output:
[1] "#807059" [1] "#3E3939"
Article Tags :