VOOZH about

URL: https://www.geeksforgeeks.org/r-language/convert-colors-from-rgb-to-hsv-in-r-programming-rgb2hsv-function/

⇱ Convert Colors from RGB to HSV in R Programming - rgb2hsv() Function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Convert Colors from RGB to HSV in R Programming - rgb2hsv() Function

Last Updated : 15 Jul, 2025
rgb2hsv() function in R Language is used to transform colors from RGB space(red / green / blue) into HSV space(hue / saturation / value).
Syntax: rgb2hsv(r, g, b) Parameters: r: vector of ‘red’ values. g: vector of ‘green’ values, or NULL when r is a matrix. b: vector of ‘blue’ values, or NULL when r is a matrix.
Example 1: Output:
 [, 1]
h 0.5641026
s 0.9686275
v 1.0000000
Example 2: Output:
 [, 1]
h 0.5833333
s 0.6666667
v 0.7058824
Comment
Article Tags:

Explore