Okay, let's do this.
Real hair is made of non-living protein fibers that grow out from living bulbs where cell division takes place and capillaries are present. The reason our hair cannot change color at our will is because there is nothing to connect it to our will nor are there any change mechanisms.
So first, connecting the hair to our will. For this we need nerves. How you design these nerves will decide how the hair changes color. For example say you had a neuron with few dendrites and many axons (i.e. accepts one input and outputs the same signal to many follicles). This would result in patchy color changes as opposed to changing individual strands of hair. A small neuron connected to every hair follicle could give precise control over every strand. Anyway, nerves are already all over our body, so it is not a stretch to say a human-like species would have an extra layer of neural communication to their hair. As a plus, if the neurons only connect to the bulb, the hair would still not feel pain when cut.
Second, the actual color change. Hair gets its colors from bits of melanin pigment woven into the growing strand. But melanin itself doesn't change when a person changes color (i.e. getting a tan), only the concentration does. So by expanding the capillaries in the bulb of the hair into the whole follicle, you could allow for more melanin to be pumped into the follicle at a given signal, in this case wilful thought. The downside is that hair would now bleed when cut. Another possibility is to make a new protein for your world that can shift the conjugation of its bonds when receiving an electron from an electrical signal, thus changing it's color. (Do I need to provide electron-pushing mechanisms for this to count as a valid science-based answer? I hope not). This way, a signal from the neuron at the bulb could cause a change all the way to the end of the follicle. This would result in the whole strand only ever being one color though. Either way could take "a few seconds."
Finally, part of how this adaptation came about is to provide a evolutionary reason. You already specified camouflage. Side effects could include attracting a mate or body language enhancements.
Metal granules stored in either the iris or the (transparent in normal humans) cornea would work. Both have living cells where metal vacuoles could be stored. It just depends on if you want the iris or the whole eye to change color, however the iris would make more sense so you don't block off the pupil. The actual metal just depends on the flavor of your story. Imagine black irises and a silicon-packed cornea that works like a mirror. Or silver-oxide storing irises.
If you want you could include sharper/hazer vision as a side effect of this evolution.
This one is already really similar to how our skin works anyway. The difference is that we have limited reasons for our skin to change. We produce more melanin when exposed to more sunlight, for example, resulting in darker skin. Another interesting one is that melanin production can be triggered by insulin. This called Acanthosis nigricans and is why you sometimes see diabetics with dark knuckles or elbows. The point is there are a number of believable things that change our skin color and you just need to add reasons to it for this to be plausible. The actual mechanism for this is the easy part. It could be as simple as saying increased humidity triggers melanin production in these people. We already have sensors in the body for temperature, humidity, irritation from sand (think producing mucus or sneezing in dust), etc. Any one of these could be attached to the melanin production (or inhibition of production) process. Since this is a species that survives by camouflage that's all the evolutionary force needed to explain why it happened. But it could be as complex as saying the dermis can bulk up in hot environments to provide more insulation from heat, the epidermis then responds by producing more melanin, forming a wearable heat sink around the whole body with the side-effect of becoming darker. As with normal skin color changes, this could take many days.