I am making a 1.14 minecraft minigame, and one aspect is when two players not on a team walk up to each other, they are put on the same team. I am wondering how to do this.I have included all 16 team colo(u)rs, and the team names are:


dark_red, green, dark_green, yellow, black, dark_blue, dark_purple, gold, red, aqua, gray, light_purple, blue, white, dark_aqua, dark_gray

Please help!