Skip to content

Api > Color > RGBToHSV()


Color.RGBToHSV(Color rgbColor)⚓︎

Calculates the hue, saturation and value of an RGB input color.

Parameters:⚓︎

Name Type Description
rgbColor Color An input color.

Returns:⚓︎

type Description
number Output variable for hue (H).
number Output variable for saturation (S).
number Output variable for value (V).

Usage⚓︎

---@type Color
local rgbColor;


local val0, val1, val2 = Color:RGBToHSV(rgbColor)

Extra Detail⚓︎

The H, S, and V are output in the range 0.0 to 1.0.