# meaning of "for each of"

I am reading this euler project question and found this sentences.

70 colored balls are placed in an urn, 10 for each of the seven rainbow colors.

There are 70 colored balls in an urn and every 1 of 10 balls have a color in seven rainbow colors.

Is my understanding correct? else what is the correct meaning of this. Actually the second sentence is the one confused me.

The pattern

`for each of the {number} {nouns}`

is a kind of iterator: each item in the set of items is visited in turn.

There are six children in your group. For each of the children, assemble a packet with a ruler, a pencil, an eraser, and a compass.

You need, in all, six rulers, six pencils, six erasers, and six compasses.

Your sentence starts with the total, and then explains how we reached the total:

70 colored balls are placed in an urn, 10 for each of the seven rainbow colors.

That is, 70 colored balls are placed in an urn, 10 [balls] for each of the seven rainbow colors.

Here it is in the form of an instruction:

For each of the seven rainbow colors, place ten balls of that color in the urn.

The seven rainbow colours are: red, orange, yellow, green, blue, indigo, and violet. In the urn are ten balls of each of these colours, making 70 altogether.