This is just this https://scratch.mit.edu/projects/1057722991/ But with the dude The red, green, and blue get different sized “egg cartons” and then they’re stacked on each other. It gets closer to the correct color when the tops of the “cartons” overlap.
Press a few times Shift+click the flag