Hi! So, the scientist are able to explain that the colors observed in matter depend on the structure of atom, because the protons inside the atom is the one who determine what chemical structure there should be in one atom and that the electrons inside the atom is the one who shows it(specifically, the electrons in the outer shells or orbital path of atom).
Alright! That's it for now, BYE!