# Player Color

Grammaroption|Current/Default player player color
FlagsNative | Function

Returns the player color of the player.

# Arguments

Returns — int [ playercolor ]

native int PlayerGetColorIndex(
	int inPlayer,
	bool inDefault,
);

Category: Player / Player Settings

# Examples

# campaigns/swarm.sc2campaign

MapScript.galaxy

// L842
PlayerGetColorIndex(gv_pLAYER_02_ZERG, false)
// L811
PlayerGetColorIndex(gv_pLAYER_01_USER, false)
// L842
PlayerGetColorIndex(gv_pLAYER_02_ZERG, false)
// L811
PlayerGetColorIndex(gv_pLAYER_01_USER, false)

# mods/core.sc2mod

DebugAI.galaxy

// L26
PlayerGetColorIndex(player, false)
// L26
PlayerGetColorIndex(player, false)

# mods/heroesdata.stormmod

GameLib.galaxy

// L10018
PlayerGetColorIndex(libGame_gf_ComputerPlayerInTeam(lp_team), false)

# mods/heroesdata.stormmod

HeroesLib.galaxy

// L3795
PlayerGetColorIndex(0, false)

# mods/liberty.sc2mod

LibertyLib.galaxy

// L155
PlayerGetColorIndex(lp_player, false)
// L242
PlayerGetColorIndex(lp_player, false)
// L335
PlayerGetColorIndex(lp_player, false)

# mods/starcoop/starcoop.sc2mod

LibCOUI.galaxy

// L760
PlayerGetColorIndex(1, false)
// L762
PlayerGetColorIndex(2, false)
// L766
PlayerGetColorIndex(2, false)
// L768
PlayerGetColorIndex(1, false)
// L973
PlayerGetColorIndex(lp_player, false)
// L984
PlayerGetColorIndex(libCOOC_gf_CC_PlayerAlly(lp_player), false)
// L5988
PlayerGetColorIndex(2, false)
// L5991
PlayerGetColorIndex(1, false)

# mods/warcoop/warclassic.sc2mod

WarClassic.galaxy

// L1064
PlayerGetColorIndex(lv_p, false)

# mods/warcoop/warcoopdata.sc2mod

WarCoopData.galaxy

// L937
PlayerGetColorIndex(lv_currentIndex, false)
// L3088
PlayerGetColorIndex(lv_player, false)

# mods/warcoop/warmeleeai.sc2mod

DebugAIWar3.galaxy

// L26
PlayerGetColorIndex(player, false)