sixsidepentagon
Great question. Eye doctor here.
Eye color is in the Iris, and the Iris has two layers, a back layer that's always fully pigmented, and front layer.
The pigment is melanin, same that makes our skin different colors.
Now when the front layer is densely pigmented, it appears dark, like brown or even black (though shine a bright enough light and you'll see black eyes are just very dark brown).
If it's not pigmented, it appears light blue. Why? Same reason the sky's blue, light scatters in it. Light scattering is a different topic, but basically short wavelengths (ie blue) bounce differently in the fluffy front layer without pigment.
What about in between? Well it turns out if there's pigment but it's not super dense, it's a bit of a lighter brown or dark orange. We call these amber eyes.
If it's between amber and blue, then it's like a cross between light orange and blue. That's how you get green eyes.
So that's how you get the spectrum: from blue to green to amber to brown to black.
So what about "red" or "violet" eyes? Turns out I lied in the beginning; that back layer I mentioned that's always pigmented isn't in a medical condition: Albinism. These folks unfortunately have a defect in producing melanin pigment, which is why they all have fair skin and light hair and such.
So why red? It's the same reason you can get red eyes in flash photography; the red is the color of the retina in the back of the eye. Flash photography causes you to accidentally image peoples retinas.
Now without the pigment in the back layer of the iris, the iris almost functionally becomes like Saran Wrap; it's clear and doesn't block out light anymore. So when you see red (or violet) eyes, you're seeing retina through their Iris.
Side note: this is one reason why folks with albinism have poor vision. The purpose of the iris is to act like a camera aperature. Without pigment, it can't block out light like an aperature, removing a whole element of the focusing system of the eye.

好问题。我是眼科医生。
眼睛的颜色取决于虹膜,虹膜有两层,一层是前层,一层是富含色素的后层。
这种色素就是黑色素,黑色素使我们的皮肤呈现出不同的颜色。
当虹膜前层拥有密集的色素时,眼镜颜色就会变暗,变成棕色,甚至是黑色(在足够明亮的光线下,你会看到黑色的眼睛其实只是深棕色)。
如果虹膜前层没有黑色素,那么眼睛就是浅蓝色的。为什么?和天空是蓝色的原因一样,短波光线(即蓝光)在没有色素的虹膜前层发生了散射。
如果黑色素少一点,你的眼睛就会变成绿色。
那么如果虹膜前层黑色素不是非常密集,眼睛颜色就会是浅棕色或深橙色。我们称之为琥珀眼睛。
所以这就是人类眼睛颜色的变化规律,随着黑色素增多,从蓝色到绿色到琥珀色到棕色再到黑色。
那么“红色”或“紫色”眼睛是怎么来的呢?还记得我上面提到的富含色素的虹膜后层吗?每个人的虹膜后层都拥有黑色素,但除了一种情况:白化病。
不幸的是,白化病患者在产生黑色素方面有缺陷,这就是为什么他们都有白皙的皮肤和浅色的头发等等。
为什么会出现红色眼睛?这和用闪光灯拍照时眼睛会发红是一个道理;红色是眼睛后部视网膜的颜色。闪光灯会让你拍出人眼视网膜的图像。
由于白化病患者没有了虹膜后层的色素,虹膜就成了一个透明的保鲜膜,无法挡住光线。所以当你看到红色(或紫色)眼睛时,你实际上是看到了他们虹膜后面的视网膜。
附注:这是白化病患者视力差的一个原因。虹膜的作用就像照相机的光圈。如果没有色素,它就不能像光圈一样挡住光线,眼睛也就失去了聚焦系统。