The problem is, when i run the code i see the diferent colors but it paint all rectangles with the same color, and after it run all the code it will appear just one color in all rectangles.
What is the best way to paint them with diferent colors?
I have another question, what i need to do for the rectangles don't disapear when i minimize the window?
I just solved the 1st question, now i see the rectangles with multiple colors.
But the other question i can't solve, why it disapears when i minimize or scroll down?