Origin of the different color of ruby and emerald