The common mixing of RGB colors is very different from mixing colors for paintings, it\'s mixing of light instead mixing of pigments.
For example:
Bl
Wondering if calculation of inversion of the RGB value work. Since it's about subtraction of lights, technically the subtraction part can be calculated by simple math.
For example cyan + yellow
cyan = 0x00ffff yellow = 0xffff00
Their inversions are 0xff0000 and 0x0000ff, meaning they absorbed red and blue lights completely. Their 1:1 mixture should absorb half of red and blue lights (since the other half of the mixture can still reflects some red and blue light), which is consistent with (0xff0000 + 0x00ffff) / 2 = 0x7f007f. Now we subtract the value from 0xffffff we have 0x80ff80 which is green!