Well, that's the other end of the problem; most state vehicle lighting codes are a mess; generally they weren't connected to reality in 1938 (or so) when they were written, and have been hacked and tweaked in bits and parts for 75 years by ignorant legislatures influenced by commercially-interested lobbyists. Virtually every vehicle on the road today is technically illegal according to many state lighting codes. Fortunately, the Federal Motor Vehicle Safety Standards preempt conflicting state codes.
Of course I have seen newer OEM stuff that does not pass that test either,