# Convert Player Color To Color
Grammar — Color(playerColor)
Flags —Function
Converts a player color value to an actual color
# Arguments
int
<playercolor> — Player Color
Returns — color
color libNtve_gf_ConvertPlayerColorToColor(
int lp_playerColor,
);
# Related
Category: Conversion / Color Conversions
- Convert Reals To Color —
color
— Color - Convert Reals To Color With Alpha —
color
— ColorWithAlpha - Color Component —
fixed
— ColorGetComponent - Convert Real Color Component to Integer 255 Color Component —
int
— Color255FromFixed - Convert Color Index To Color —
color
— ColorFromIndex - Convert Player Color To Color —
color
— libNtve_gf_ConvertPlayerColorToColor
# Examples
campaigns/swarmstory.sc2campaign — base.sc2data/TriggerLibs/SwarmCampaignLib.galaxy:9494
TextExpressionSetToken("Param/Expression/lib_SwaC_7FD2F0AE", "B", libSwaC_gf_ZS_ArmyUnitTooltip2(lv_indexArmyUnit));
libNtve_gf_SetDialogItemTooltip(libSwaC_gv_zS_ArmyCustomMissionUnitFrames[lv_index], TextExpressionAssemble("Param/Expression/lib_SwaC_7FD2F0AE"), PlayerGroupAll());
libNtve_gf_SetDialogItemTeamColor(libSwaC_gv_zS_ArmyCustomMissionUnits[lv_index], libNtve_gf_ConvertPlayerColorToColor(libSwaC_gf_CampaignKerriganZergPlayerColor()), PlayerGroupAll());
lv_index += 1;
autoC0F182A6_ai = autoC0F182A6_ai + 1;
campaigns/swarmstoryutil.sc2mod — base.sc2data/Lib281DEC45.galaxy:1470
libNtve_gf_SetDialogItemUnitLink(lib281DEC45_gv_zSS_UITravelRewardUnit[lv_unitFrameIndex], (CatalogFieldValueGet(c_gameCatalogArmyCategory, libSwaC_gf_MissionArmyCategoryUnlocked(lv_indexMap), "Unit", c_playerAny)), PlayerGroupAll());
libNtve_gf_SetDialogItemCamera(lib281DEC45_gv_zSS_UITravelRewardUnit[lv_unitFrameIndex], libSwaC_gf_StoryArmyCategoryPlanetCamera(libSwaC_gf_MissionArmyCategoryUnlocked(lv_indexMap)), PlayerGroupAll());
libNtve_gf_SetDialogItemTeamColor(lib281DEC45_gv_zSS_UITravelRewardUnit[lv_unitFrameIndex], libNtve_gf_ConvertPlayerColorToColor(libSwaC_gf_CampaignKerriganZergPlayerColor()), PlayerGroupAll());
DialogControlSetVisible(lib281DEC45_gv_zSS_UITravelRewardUnitPanel[lv_unitFrameIndex], PlayerGroupAll(), true);
libNtve_gf_SetDialogItemText(lib281DEC45_gv_zSS_UITravelRewardUnitLabel[lv_unitFrameIndex], libSwaC_gf_StoryArmyCategoryName(libSwaC_gf_MissionArmyCategoryUnlocked(lv_indexMap)), PlayerGroupAll());
campaigns/swarmstoryutil.sc2mod — base.sc2data/Lib281DEC45.galaxy:1644
libNtve_gf_SetDialogItemUnitLink(lib281DEC45_gv_zSS_MissionUnit, (CatalogFieldValueGet(c_gameCatalogArmyCategory, libSwaC_gf_MissionArmyCategoryUnlocked(lib281DEC45_gv_zSS_NextMission), "Unit", c_playerAny)), PlayerGroupAll());
libNtve_gf_SetDialogItemCamera(lib281DEC45_gv_zSS_MissionUnit, libSwaC_gf_StoryArmyCategoryPlanetCamera(libSwaC_gf_MissionArmyCategoryUnlocked(lib281DEC45_gv_zSS_NextMission)), PlayerGroupAll());
libNtve_gf_SetDialogItemTeamColor(lib281DEC45_gv_zSS_MissionUnit, libNtve_gf_ConvertPlayerColorToColor(libSwaC_gf_CampaignKerriganZergPlayerColor()), PlayerGroupAll());
TextExpressionSetToken("Param/Expression/lib_281DEC45_0E2BCC46", "A", libSwaC_gf_StoryArmyCategoryName(libSwaC_gf_MissionArmyCategoryUnlocked(lib281DEC45_gv_zSS_NextMission)));
TextExpressionSetToken("Param/Expression/lib_281DEC45_0E2BCC46", "B", libSwaC_gf_StoryArmyCategoryName2(libSwaC_gf_MissionArmyCategoryUnlocked(lib281DEC45_gv_zSS_NextMission)));
campaigns/voidstory.sc2campaign — base.sc2data/TriggerLibs/VoidCampaignUILib.galaxy:1989
libNtve_gf_SetDialogItemUnitLink(libVCUI_gv_pU_MissionRewardUnitModel, libVoiC_gf_PC_ArmyCategoryUnitType(lv_rewardCategory), PlayerGroupAll());
libNtve_gf_SetDialogItemCamera(libVCUI_gv_pU_MissionRewardUnitModel, libVoiC_gf_PC_ArmyCategoryPlanetCamera(lv_rewardCategory), PlayerGroupAll());
libNtve_gf_SetDialogItemTeamColor(libVCUI_gv_pU_MissionRewardUnitModel, libNtve_gf_ConvertPlayerColorToColor(libVCMI_gf_CampaignPlayerColor()), PlayerGroupAll());
TextExpressionSetToken("Param/Expression/lib_VCUI_225AD1C1", "A", libVoiC_gf_PC_ArmyCategoryName(lv_rewardCategory));
TextExpressionSetToken("Param/Expression/lib_VCUI_225AD1C1", "B", libVoiC_gf_PC_ArmyCategoryUnitDescription(lv_rewardCategory));
campaigns/voidstory.sc2campaign — base.sc2data/TriggerLibs/VoidCampaignUILib.galaxy:2000
libNtve_gf_SetDialogItemUnitLink(libVCUI_gv_pU_MissionRewardUnitModel2, "ShieldBattery", PlayerGroupAll());
libNtve_gf_SetDialogItemCamera(libVCUI_gv_pU_MissionRewardUnitModel2, libVoiC_gf_PC_ArmyCategoryPlanetCamera("ShieldBattery"), PlayerGroupAll());
libNtve_gf_SetDialogItemTeamColor(libVCUI_gv_pU_MissionRewardUnitModel2, libNtve_gf_ConvertPlayerColorToColor(libVCMI_gf_CampaignPlayerColor()), PlayerGroupAll());
TextExpressionSetToken("Param/Expression/lib_VCUI_2A34C43A", "A", libVoiC_gf_PC_ArmyCategoryName("ShieldBattery"));
TextExpressionSetToken("Param/Expression/lib_VCUI_2A34C43A", "B", libVoiC_gf_PC_ArmyCategoryUnitDescription("ShieldBattery"));
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:10018
// Automatic Variable Declarations
// Implementation
return libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(libGame_gf_ComputerPlayerInTeam(lp_team), false));
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/HeroesLib.galaxy:3585
if ((lp_unit != null)) {
if ((PlayerGroupHasPlayer(libGame_gf_PlayersOnTeamHeroes(libGame_gv_teamOrderIndex_C, true), UnitGetOwner(lp_unit)) == true)) {
PortraitSetTeamColor(lv_portrait, libNtve_gf_ConvertPlayerColorToColor(2));
}
else if ((PlayerGroupHasPlayer(libGame_gf_PlayersOnTeamHeroes(libGame_gv_teamChaosIndex_C, true), UnitGetOwner(lp_unit)) == true)) {
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/HeroesLib.galaxy:3588
}
else if ((PlayerGroupHasPlayer(libGame_gf_PlayersOnTeamHeroes(libGame_gv_teamChaosIndex_C, true), UnitGetOwner(lp_unit)) == true)) {
PortraitSetTeamColor(lv_portrait, libNtve_gf_ConvertPlayerColorToColor(1));
}
else if (true) {
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/HeroesLib.galaxy:3591
}
else if (true) {
PortraitSetTeamColor(lv_portrait, libNtve_gf_ConvertPlayerColorToColor(2));
}
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/HeroesLib.galaxy:3595
}
else {
PortraitSetTeamColor(lv_portrait, libNtve_gf_ConvertPlayerColorToColor(2));
}
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/HeroesLib.galaxy:3785
if ((lp_unit != null)) {
if ((PlayerGroupHasPlayer(libGame_gf_PlayersOnTeamHeroes(libGame_gv_teamOrderIndex_C, true), UnitGetOwner(lp_unit)) == true)) {
PortraitSetTeamColor(lv_portrait, libNtve_gf_ConvertPlayerColorToColor(2));
}
else if ((PlayerGroupHasPlayer(libGame_gf_PlayersOnTeamHeroes(libGame_gv_teamChaosIndex_C, true), UnitGetOwner(lp_unit)) == true)) {
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/HeroesLib.galaxy:3788
}
else if ((PlayerGroupHasPlayer(libGame_gf_PlayersOnTeamHeroes(libGame_gv_teamChaosIndex_C, true), UnitGetOwner(lp_unit)) == true)) {
PortraitSetTeamColor(lv_portrait, libNtve_gf_ConvertPlayerColorToColor(1));
}
else if (true) {
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/HeroesLib.galaxy:3791
}
else if (true) {
PortraitSetTeamColor(lv_portrait, libNtve_gf_ConvertPlayerColorToColor(0));
}
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/HeroesLib.galaxy:3795
}
else {
PortraitSetTeamColor(lv_portrait, libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(0, false)));
}
}
mods/liberty.sc2mod — base.sc2data/TriggerLibs/LibertyLib.galaxy:155
}
libNtve_gf_CreatePingFacingAngle(lv_pingPlayers, lv_pingMinimapModel, lp_pingLocation, libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(lp_player, false)), 5.0, 270.0);
PingSetScale(PingLastCreated(), lv_pingScale);
SoundPlayForPlayer(lv_pingSound, c_maxPlayers, lv_pingPlayers, 100.0, 0.0);
mods/liberty.sc2mod — base.sc2data/TriggerLibs/LibertyLib.galaxy:242
}
libNtve_gf_CreatePingFacingAngle(lv_pingPlayers, lv_pingMinimapModel, lp_pingTargetPosition, libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(lp_player, false)), 5.0, 270.0);
PingSetScale(PingLastCreated(), lv_pingScale);
SoundPlayForPlayer(lv_pingSound, c_maxPlayers, lv_pingPlayers, 100.0, 0.0);
mods/liberty.sc2mod — base.sc2data/TriggerLibs/LibertyLib.galaxy:335
DialogControlCreate(DialogLastCreated(), c_triggerControlTypeLabel);
libLbty_gv_meleeSurrender_Title[lp_player] = DialogControlLastCreated();
libNtve_gf_SetDialogItemText(DialogControlLastCreated(), (TextWithColor(PlayerName(lp_player), libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(lp_player, false))) + StringExternal("Param/Value/lib_Lbty_1D191C56")), PlayerGroupAll());
DialogControlSetSize(DialogControlLastCreated(), PlayerGroupAll(), 360, 50);
libNtve_gf_SetDialogItemStyle(DialogControlLastCreated(), "AISurrenderTitle", PlayerGroupAll());
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOUI.galaxy:760
libCOUI_gv_cU_CommanderAccountNameAlly = DialogControlLastCreated();
libNtve_gf_SetDialogItemText(DialogControlLastCreated(), PlayerName(1), PlayerGroupSingle(2));
libNtve_gf_SetDialogItemColor(DialogControlLastCreated(), libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(1, false)), PlayerGroupSingle(2));
libNtve_gf_SetDialogItemText(DialogControlLastCreated(), PlayerName(2), PlayerGroupSingle(1));
libNtve_gf_SetDialogItemColor(DialogControlLastCreated(), libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(2, false)), PlayerGroupSingle(1));
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOUI.galaxy:762
libNtve_gf_SetDialogItemColor(DialogControlLastCreated(), libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(1, false)), PlayerGroupSingle(2));
libNtve_gf_SetDialogItemText(DialogControlLastCreated(), PlayerName(2), PlayerGroupSingle(1));
libNtve_gf_SetDialogItemColor(DialogControlLastCreated(), libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(2, false)), PlayerGroupSingle(1));
DialogControlHookup(libCOUI_gv_cU_CommanderPanel, c_triggerControlTypeLabel, "AccountLabelSelf");
libCOUI_gv_cU_CommanderAccountNameSelf = DialogControlLastCreated();
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOUI.galaxy:766
libCOUI_gv_cU_CommanderAccountNameSelf = DialogControlLastCreated();
libNtve_gf_SetDialogItemText(DialogControlLastCreated(), PlayerName(2), PlayerGroupSingle(2));
libNtve_gf_SetDialogItemColor(DialogControlLastCreated(), libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(2, false)), PlayerGroupSingle(2));
libNtve_gf_SetDialogItemText(DialogControlLastCreated(), PlayerName(1), PlayerGroupSingle(1));
libNtve_gf_SetDialogItemColor(DialogControlLastCreated(), libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(1, false)), PlayerGroupSingle(1));
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOUI.galaxy:768
libNtve_gf_SetDialogItemColor(DialogControlLastCreated(), libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(2, false)), PlayerGroupSingle(2));
libNtve_gf_SetDialogItemText(DialogControlLastCreated(), PlayerName(1), PlayerGroupSingle(1));
libNtve_gf_SetDialogItemColor(DialogControlLastCreated(), libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(1, false)), PlayerGroupSingle(1));
DialogControlHookup(libCOUI_gv_cU_CommanderPanel, c_triggerControlTypeButton, "ReadyButton");
libCOUI_gv_cU_CommanderReadyButton = DialogControlLastCreated();
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOUI.galaxy:973
libNtve_gf_SetDialogItemPaused(libCOUI_gv_cU_CommanderButtonPortrait[lv_commIndex], false, lv_playerSelf);
DialogControlSetVisible(libCOUI_gv_cU_CommanderButtonSelectionBorder[lv_commIndex], libCOOC_gv_cC_HumanPlayerGroup, true);
libNtve_gf_SetDialogItemColor(libCOUI_gv_cU_CommanderButtonSelectionBorder[lv_commIndex], libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(lp_player, false)), libCOOC_gv_cC_HumanPlayerGroup);
}
else {
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOUI.galaxy:984
libNtve_gf_SetDialogItemPaused(libCOUI_gv_cU_CommanderButtonPortrait[lv_commIndex], false, libCOOC_gv_cC_HumanPlayerGroup);
DialogControlSetVisible(libCOUI_gv_cU_CommanderButtonSelectionBorder[lv_commIndex], libCOOC_gv_cC_HumanPlayerGroup, true);
libNtve_gf_SetDialogItemColor(libCOUI_gv_cU_CommanderButtonSelectionBorder[lv_commIndex], libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(libCOOC_gf_CC_PlayerAlly(lp_player), false)), libCOOC_gv_cC_HumanPlayerGroup);
}
else {
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOUI.galaxy:5988
lv_mapScale = (lv_baseMapSize / MaxF(libNtve_gf_WidthOfRegion(RegionPlayableMap()), libNtve_gf_HeightOfRegion(RegionPlayableMap())));
lv_mapScale = (lv_mapScale * lv_baseScale);
libNtve_gf_CreatePingFacingAngle(PlayerGroupSingle(1), "PingViewArea", CameraGetTarget(2), libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(2, false)), 0.0, 270.0);
PingSetScale(PingLastCreated(), lv_mapScale);
libCOUI_gv_cU_MinimapAllyViewPing[1] = PingLastCreated();
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOUI.galaxy:5991
PingSetScale(PingLastCreated(), lv_mapScale);
libCOUI_gv_cU_MinimapAllyViewPing[1] = PingLastCreated();
libNtve_gf_CreatePingFacingAngle(PlayerGroupSingle(2), "PingViewArea", CameraGetTarget(1), libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(1, false)), 0.0, 270.0);
PingSetScale(PingLastCreated(), lv_mapScale);
libCOUI_gv_cU_MinimapAllyViewPing[2] = PingLastCreated();
mods/warcoop/warclassic.sc2mod — base.sc2data/TriggerLibs/WarClassic.galaxy:1064
lv_uT = EventPlayerEffectUsedUnitType(c_effectUnitCaster);
lv_p = EventPlayerEffectUsedUnitOwner(c_effectPlayerCaster);
lv_color = libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(lv_p, false));
lv_ally = PlayerGroupAlliance(c_playerGroupAlly, lv_p);
lv_prop = UnitGetName(lv_u);
mods/warcoop/warcoopdata.sc2mod — base.sc2data/TriggerLibs/WarCoopData.galaxy:937
if ((PlayerGroupHasPlayer(libWCdr_gv_legends.lv_legendPlayers, lv_currentIndex) == true)) {
DialogControlSetAnimationState(libWCdr_gv_debugHeroSelectUI.lv_readyPanels[lv_currentIndex].lv_readyPanel, PlayerGroupAll(), libWCdr_gv_animationStates.lv_emptyState, libWCdr_gv_animationStates.lv_emptyState_NotEmpty);
libNtve_gf_SetDialogItemColor(libWCdr_gv_debugHeroSelectUI.lv_readyPanels[lv_currentIndex].lv_playerLabel, libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(lv_currentIndex, false)), PlayerGroupAll());
libNtve_gf_SetDialogItemText(libWCdr_gv_debugHeroSelectUI.lv_readyPanels[lv_currentIndex].lv_playerLabel, PlayerName(lv_currentIndex), PlayerGroupAll());
}
mods/warcoop/warcoopdata.sc2mod — base.sc2data/TriggerLibs/WarCoopData.galaxy:3088
lv_player = PlayerGroupNextPlayer(auto187B1612_g, lv_player);
if (lv_player < 0) { break; }
libNtve_gf_SetDialogItemTeamColor(libWCdr_gv_gameUI.lv_hero_Portrait, libNtve_gf_ConvertPlayerColorToColor(PlayerGetColorIndex(lv_player, false)), PlayerGroupSingle(lv_player));
libNtve_gf_SetDialogItemCamera(libWCdr_gv_gameUI.lv_hero_Portrait, "Camera01", PlayerGroupAll());
}