Garry's Mod Wiki

Vector:ToColor

table Vector:ToColor()

Description

Translates the Vector (values ranging from 0 to 1) into a Color. 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

1 table
The created Color.

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

Page Links


Special Pages


Wikis

?

Render Time: 34ms

DB GetPage 6
Generate Html 4
SaveChanges (1) 13
Render Body 0
Render Sidebar 8