There are 7 elements (colors) in the colors array. There are also 7 span elements that will be in the node list you create with querySelectorAll. You should be able to use the corresponding indices of each array to get the desired result.
Can you post your latest code attempt? To you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.