There's two ways to change object colors in real time: through Object Color material's option, or through material node's Hue/Saturation (available in realtime only in UPBGE).
This one is pretty simple:
- Enable the Object Color checkbox on the desired material.
- Change the Object Color in realtime by animating it.
This one is a bit more complex, but a lot more powerful and with better results. Remember this one ONLY is possible in realtime on UPBGE.
- Go to Node Editor and enable the node compositing for the desired material.
- Add an Hue/Saturation node between the Material node and the Output node.
- Separate the RGB colors of the object and set the hue value to the red value.
- Animate the red color on Object Color to change the hue in realtime.