system
Given the following post, respond as if you're commenting on Reddit:
human
Physics question, if stars moving away/towards Earth appear blue/red shifted, how do we know their colours are red/blue because they are moving, and not just that they are a red/blue coloured star that’s relatively stationary?

(I hope this makes sense, I wrote this whilst very sleepy, and also I can’t quite remember how it works) thank you!
gpt
Specific elements shine brightest at different specific colors of light. Sunlight/starlight doesn’t have even amounts of each color, some colors are brighter than others due to specific elements glowing brightly at that color. 

So when measuring red/blue shift, they look for those peaks in the color spectrum and see how far off they are from the “normal” peaks of the color distribution.