These images are all (orthographic) projections of the same cube.
It has the three basic colors, with opposite faces identical. When one is in front of the other their colors are added in the projection.
The final answer is a variation on these two pictures, depending on how you rotate the cube:
A more detailed explanation of the answer:
First: We just see the two red faces superposed.
Second: Now the cube is rotated, with the green faces in place of red. However, it is slightly tilted so the blue sides mix with the green forming the cyan rectangles.
Third: The cube is at 45 degrees with the ground, so red and green faces superpose completely at top, as well as green and red at the bottom, giving an uniform yellow color.
Fourth: Finally, we see a similar arrangement to the second picture except in a different plane of rotation.
Also, we can notice differences in size between the rectangles. That's no mistake: When a cube rotates along a coordinate axis, its visual size increases from $l$ to $l \sqrt2$, then goes back down to $l$.
The yellow is the biggest rectangle because the diagonal of a square is the longest line segment inside it.
Our last projection is the cube viewed vertex-on, which has a hexagonal envelope.
This picture shows how you combine colors of face pairs in the X, Y and Z axis to get the final answer:
This puzzle was actually pretty easy for me to figure out because I love trying to visualize higher-dimensional spaces, so I was very well familiar with projections, envelopes, cross sections and stuff.
It's a fascinating way to improve your spatial reasoning, so I highly recommend anyone interested to take a look. Or you could just try exploring a 4d maze and see if you can find your way out