In almost all countries, headlights must be yellow or white. Different countries however have different laws, but the general guideline is that halogen bulbs with a color temperature of over 4200K are not road legal. This is because of the particular blue tint that bulbs give out when they reach higher color temperatures. This can confuse drivers to mistake these lights for the blue lights used for emergency services that could distract or mislead drivers on the road.
Xenon HID bulbs are however different to halogens. Drivers often prefer the brightness and look of Xenon HID headlights, which could be comparatively brighter and whiter or bluer than standard headlights due to their higher color temperature. Nevertheless, HID being a relatively new technology in headlights, legislation is yet to catch up regarding their use. In many countries, the color temperature of HID bulbs may even be much higher than halogen and may yet remain road legal.
The basic function of headlights is to illuminate the way in the dark and enable drivers to see clearly during night driving. Nowadays drivers are more likely to run into trouble with headlights that are too bright rather than too dim. With the increasing popularity of cheap HID conversion kits and Xenon HID upgrades, headlights can sometimes be dangerously bright to the point of causing harm to drivers of oncoming vehicles.
Bulbs that are too bright can cause momentary blindness in oncoming drivers, making it impossible for them to see clearly. They act like the flash of a camera getting directly into the eyes of oncoming drivers, at times causing serious accidents. To address this, most governments have introduced legislation regulating the maximum brightness of headlight bulbs. Mostly, these laws specify that headlight beams should not illuminate the road beyond a set distance.
Proper usage of lights is the next important aspect of headlight legislation. In the UK, US, Canada and Australia, the law requires headlights to be used between sunset and sunrise. The enforcement and timing may vary depending upon the location.
In addition to using headlights at night, it's a statutory requirement to turn the headlights on in poor visibility conditions whenever required. Most areas have laws stating exactly when and under what circumstances drivers are expected to turn on their lights, especially when visibility is limited to less than a set distance ahead of the vehicle. Local laws in some places require drivers to have their headlights on whenever the windscreen wipers are in use. This not only gives drivers better visibility of the road ahead but also makes it easy to spot vehicles in poor weather conditions.
Like in case of headlights, in the UK, US, Canada and Australia, as well as most other countries, the law requires tail lights and brake lights to be red. Taillights should be bright enough for drivers behind to spot you clearly. Brake lights should be distinctly and visibly brighter, enough to give an indication that you are braking to those who are following you.