From Quake Wiki

Builtin definitions:

void(entity ent, float colors) setcolor = #401;

Engine called QC functions (optional):

void(float color) SV_ChangeTeam;

Setcolor sets the color on a client and updates internal color information accordingly (equivilant to stuffing a "color" command but immediate).

SV_ChangeTeam is called by the engine whenever a "color" command is recieved, it may decide to do anything it pleases with the color passed by the client, including rejecting it (by doing nothing), or calling setcolor to apply it, preventing team changes is one use for this.

The color format is pants + shirt * 16 (0-255 potentially).