You can't choose red or blue, only team color. I know that there exists a function that tricks the game into thinking you are on the other team to force a color but I don't know if it actually works or is reliable.
index is the specific player which is often called "id" in most plugins/functions and is the player's entity index.