Colour mixing in Blender Game Engine I want to create a game which is to choose two parents to generate a child with the mid-point of colour from parents. 
For example: There are two cube, A is RGB(255, 0, 0), B is RGB(0,0,255). When I click a button, then the system will generate a new cube which is C, C is their child with parent colour mixed, C is the mid-point colour of its parent RGB(128, 0, 128). 
Then, if I have many parents with different colour, I select two from the parents pool and hope the system to generate the child with the mid-point colour from parents. How can I do it?
As the RGB color space is 3Dimensional I suggest to directly set the object color via Python.

import bge

object = bge.logic.getCurrentController().owner

red = ... # value between 0.0 and 1.0
green = ... # value between 0.0 and 1.0
blue = ... # value between 0.0 and 1.0
alpha = 1.0

object.color = (red, green, blue, alpha)


You can calculate the "mixed" value by calculating the average:

def mean(*numbers):
    return sum(numbers)/len(numbers) if numbers else None


usage:

red = mean(0.3, 0.7)