The colors of the transition metal ions in aqueous solution is best described by something called "crystal field theory". It has to do with the fact that the electrons in the d-orbitals aren't all at the same energy when there are molecules or ions "attached" to the metal ion. We call these attached ions or molecules "ligands".
The effect of the ligands is to split the d-level into two or more energy levels. When light strikes the ions in solution, some of the energy with visible wavelengths is absorbed by electrons moving from a lower level to a higher level and what we see is the light energy that is left over.
We see different colours because of the slight differences in the energy levels between the two levels that the d-sublevel splits into. If the two levels are farther apart in energy then the energy difference will be greater and it will absorb light closer to the blue/ violet end of the spectrum. This will cause the solution to appear yellow. If there is little difference in energy between the two levels then the electron may absorb at the red end of the spectrum, and this would cause the solution to be green.