ColorRGBToHSV

Converts a color from red-green-blue (RGB) to hue-saturation-value (HSV) format.

Syntax

Rhino.ColorRGBToHSV (lngRGB)

Parameters

lngRGB

Required.  Number.  The RGB color value.

Returns

Array

An array containing the hue, saturation, and brightness values if successful, where:

Element

Value

Description

0

Hue

An angle value between 0.0 and 360.0 degrees.

1

Saturation

A value between 0.0 (gray) and 1.0 (saturated).

2

Value

A value between 0.0 (black) and 1.0 (white).

Null

If not successful or on error.

Example

Dim arrHSV

arrHSV = Rhino.ColorRGBToHSV(RGB(128, 0, 255))

Rhino.Print "Hue = " & CStr(arrHSV(0))

Rhino.Print "Saturation = " & CStr(arrHSV(1))

Rhino.Print "Value= " & CStr(arrHSV(2))

Also See

ColorHSVToRGB