Garry's Mod Wiki

Garry's Mod Wiki

  Vector Color:ToVector()

Description

Translates the Color into a Vector, losing the alpha channel. This will also range the values from 0 - 255 to 0 - 1

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

This is the opposite of Vector:ToColor

Returns

1 Vector
The created Vector

Example

Useful when setting player colors, since the function requires a vector as argument.

Entity( 1 ):SetPlayerColor( Color( 220, 20, 60 ):ToVector() )
Output: Sets the player color for Player1 (only works if they are using a colorable player model)

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated twice a day. Edits and history are not available.

Last Parsed: Loading...