The most important idea is that you have to undo the gamma correction, work with linear light (probably 16 bits), and then apply the gamma correction again. In linear light it is meaningful to average colors, add colors (like you have two projectors pointed at the wall), simulate subtractive colors (filters), etc.