Vector/ToColor

From Garry's Mod
Jump to: navigation, search
 Vector:ToColor( )

Contents

Description

Translates the Vector (values ranging from 0 to 1) into a Color structure. This will also range the values from 0 - 1 to 0 - 255.

x * 255 -> r
y * 255 -> g
z * 255 -> b

This is the opposite of Color:ToVector

Returns

table

The created Color structure.

Examples

Example

Get the Player1's player model color but in RGB

print( Entity( 1 ):GetPlayerColor( ):ToColor( ) )

Output:

Prints the player color of Player1 in RGB instead of a Vector
Personal tools
Navigation