How to make a beacon beam change color?

I'm making a little minigame in Minecraft, the aim of the game is to take control of the point. A point is denoted as having a beacon on it. How do I make the beacon change color depending what color team is on the point. For example in the image the orange team in on the point so I want the beacon to turn orange. However if two teams of different colors are on the point then it stays white.enter image description here


You can change beacon colors by placing a colored stained glass block above the beacon's light.

You can combine several different colors to make different colors to create different hues.

Note that Red + Blue is not Purple.