Hex implements the pie rule, also known as the swap rule. Say the colors are red versus blue, and red moves first by placing the first stone on an otherwise empty board. At that point in the game ONLY, the second player has the option to swap sides. If sides are swapped, the player who moved first as red becomes blue, and makes the next move. This is called swapping sides, or swapping dolors. If the second player chooses not to swap at that point in the game, then sides may not be swapped at all in that game. This is called the pie rule because it is like sharing the last of the pie. One person cuts the pie into two slices, and the other chooses which slice to eat. It should be mentioned that without this rule for Hex, the first player would have a strong advantage, much stronger than in chess.
Unfortunately, this swap move is not implemented ideally here. Player names are still colored red and blue the same way they were before swap. The only way to tell what color you are after swap is in the message "playerx has to move" where the name is colored correctly.
There could be another way to implement swap for some games such as Hex, which is called swapping the first piece. A blue token is added to the board IN THE CORRESPONDING LOCATION for blue, and the red token is returned to red's virtual supply. For example if red makes the first move at A4 and blue clicks on swap firstpiece, a blue token would be added to the cell D1 and the red token is removed. This is effectively the same as swapping sides as far as the game position is concerned. It might be more convenient for players to keep their assigned colors this way.
For chess, if white plays 1.b3 and black clicks on swap-sides, the first player becomes black and makes the next move. Or if black clicks swap-firstmove instead, white's b3 pawn would return to b2 and black would play b6. I'm not saying such an option would be a good idea for chess, just explaining how the swap move would work.