The boxes are each containers of uniquely colored balls. So, to get two balls of the same color, two boxes need to be opened.
or
The boxes are each a container of uniquely colored balls. So, to get two balls of the same color, two boxes need to be opened.