Garry's Mod Wiki

Revision Difference

Global.ColorToHSV#514845

<function name="ColorToHSV" parent="Global" type="libraryfunc">⤶ <description>Converts a <page>Color</page> into HSV color space.</description>⤶ <realm>Shared and Menu</realm>⤶ <args>⤶ <arg name="color" type="table">The &lt;page&gt;Color&lt;/page&gt;.</arg>⤶ </args>⤶ <rets>⤶ <ret name="" type="number">The hue in degrees [0, 360).</ret>⤶ <ret name="" type="number">The saturation in the range [0, 1].</ret>⤶ <ret name="" type="number">The value in the range [0, 1].</ret>⤶ </rets>⤶ </function>⤶ ⤶ <example>⤶ <description>Creates a color and prints the HSV values to the console.</description>⤶ <code>print(ColorToHSV(Color(255, 255, 0)))</code>⤶ <output>⤶ ```⤶ 60 1 1⤶ ```⤶ </output>⤶ ⤶ </example>