© Neil Gould, stock.xchng
Hair is a protein that gets its natural color from the presence of a pigment called melanin. Anyone who has bleached their hair can tell you it's chemically possible to render the melanin colorless. Therefore if your sudden fright has something to do with exposure to ionizing radiation or bleach, I can see white hair being a possible outcome, though less likely than baldness or death. Seriously, unless you are playing with toxic radiation or chemicals, you can't instantly change your hair color.
Can fear or stress or any extraordinary emotion change the color of your hair? Yes, but not instantly. Your psychological state has a significant impact on the hormones that can effect the amount of melanin deposited in each strand of hair, but the effect of emotion takes a long time to see. The hair you see on your head emerged from its follicle a long time ago. So, graying or any other color change is a gradual process, occurring over the course of several weeks, months, or years.
Your emotions can't instantly change the color of your hair, but it is possible you could turn gray overnight. How? A medical condition termed "diffuse alopecia areata" can result in sudden hair loss. The biochemistry of alopecia isn't well understood, but in people who have a mix of dark and gray or white hair, the uncolored hair is less likely to fall out. The result? A person can appear to go gray overnight. Although I didn't find any references on this, the implication to me is your hair thins or you become bald if you don't have any gray hair, which for some reason is less resistant to the effect. Sudden hair loss can be caused by certain drugs, medical conditions, or by sudden stress. It tends to occur over the course of several days/weeks, but the result is still dramatic.
How Hair Color Works | How Rigor Mortis Works