Global/ColorToHSV

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
m (remove Name and Parent)
m (Use interval notation)
 
Line 11: Line 11:
 
{{Ret
 
{{Ret
 
|type=number
 
|type=number
|desc=The hue in degrees.
+
|desc=The hue in degrees [0, 360).
 
}}
 
}}
 
{{Ret
 
{{Ret
 
|type=number
 
|type=number
|desc=The saturation in the range 0-1.
+
|desc=The saturation in the range [0, 1].
 
}}
 
}}
 
{{Ret
 
{{Ret
 
|type=number
 
|type=number
|desc=The value in the range 0-1.
+
|desc=The value in the range [0, 1].
 
}}
 
}}
 
{{Example
 
{{Example

Latest revision as of 15:16, 7 October 2019

 ColorToHSV( )

Contents

Description

Converts a Color structure into HSV color space.

Arguments

table color

Returns

number

The hue in degrees [0, 360).

Returns

number

The saturation in the range [0, 1].

Returns

number

The value in the range [0, 1].

Examples

Example

Creates a color and prints the HSV values to the console.

print(ColorToHSV(Color(255, 255, 0)))

Output:

60 1 1
Personal tools
Navigation