I guess that can vary from state to stateIt has nothing to do with color.
It has to do with the design of the casing and lens. A casing/lens made for halogen isn’t the same (refraction/aiming etc) as an HID and vice versa. That’s why if it’s stock HID it’s a non issue.
California Vehicle Code states: “Unless provided otherwise, the color of lamps and reflectors upon a vehicle shall be white or yellow for those visible from in front of a vehicle.”