So this is correct, but to be a little more specific in terms of how you can figure things out:
The three primary colours are red, green, and blue. All other colours are made up by combining these. Obviously there are infinitely many shades that can be made through different combinations, but in my experience, you can focus just on the following:
Black (No Red, Green, or Blue)
Red
Green
Blue
Yellow (Red and Green)
Turquoise (Green and Blue)
Purple (Blue and Red)
White (Red, Green and Blue)
Here's the interesting thing. If you have a red object, it means it reflects red light. So if you shine red light at it, that light will reflect and you will see the object as red. If you shine yellow light at it, it will reflect just the red light that makes up the yellow, and it will still look red. If you shine blue light at it, you will see black, because a red object cannot reflect the blue light.
Hence, on each floor, you can start to figure out what colours you actually have. On the first floor, which is red, you can determine which squares contain red. If they shine red, they might be red, purple, yellow or white. If they shine black, they might be black, green, blue, or turquoise. On the second floor, which is filled with purple light, you can pick out a lot more. Some squares will remain red, indicating they have no blue (they are red or yellow), some squares will remain black, indicating they have no red nor blue (they are green or black), and some red squares will turn purple, indicating they have both red and blue (they are purple or white).
So basically, as you go up each floor, take note of the colour of each square, and the colour of the light. Figure out what colours are part of each square. On the first floor you can figure out which have red and which don't. On the second floor you can figure out which have blue and which don't. On the fourth floor you can find out which have green and which don't. You should then be able to figure out precisely what every colour is.
Though you don't reach the fifth floor, you do know that it will be bathed in green light. You can now use what you've learned to figure out what each square will shine.
A square that is white, green, yellow or turquoise will shine green (because all four colours contain green), conversely, a square that is black, red, blue, or purple will shine black (because none of the four colours contain green)
Split them on this basis, and, voila.