garrynewman/garrysmod — pull request #736 by Acecool (2014-06-23 05:23:55+00:00)
Title: Added Angle:SnapTo( component, degrees ), Vector:ToColor( ), Color:ToVector( )

Added Angle:SnapTo( component, degrees ) where component is p/y/r / pitch/yaw/roll, and degrees is the interval; will return an Angle for all cases so multiple snaps can be strung on one line.

Examples, Angle( 0, 92, 0 ):SnapTo( "y", 90 ); will return Angle( 0, 90, 0 );
Angle( 0, 115, 0 ):SnapTo( "y", 45 ); will return Angle( 0, 137, 0 );
Angle( 12, 98, 167 ):SnapTo( "p", 30 ):SnapTo( "y", 45 ):SnapTo( "r", 45 ); will return Angle( 0, 90, -180 );

Added Vector:ToColor( ) to compliment other addition Color:ToVector( )
Added Color:ToVector( ) to compliment other addition Vector:ToColor( )

3 simple yet useful functions; and we may as well add to the 3 meta files...