Ok here's the low down and I'm sure even this info varies from state to state.
Part 1: HID bulbs placed in an OEM housing throw light in all directions because they are not designed with a cut off so oncoming traffic will be blinded. Where I'm from it's illegal and points against your license but not necessarily where you're from. It's the same thing as driving toward (oncoming or following) another vehicle with high beam headlights. If that illegal in your state than yes it's illegal.
Remedy: buy HID lenses from RetroFit that are designed with a cut off and you're back to DOT standards.
Part 2 Color of the light. States require white light as headlamps. As Spankis said above, blue lights are impersonating police but not so with headlights. If you had flashing blue lights in your headlamp housing maybe the officer could get away with impersonation but even that requires more than just flashing lights by case law. The real issue at hand is that the state requires 2 WHITE lights in a certain configuration between a minimum and maximum height above the ground (DOT standard). While HID lamps emit a halo of colors, what the officer will be concerned with is the high intensity portion of the light. Take a piece of white paper, place it in front of your truck's headlight at night. If the paper is white from the light you are legal, if not you are illegal.
Remedy: Change your HID to a bulb with a different temperature. Generally white lights range from the 4000 Kel (yellowish) to the 8000 kel Blueish) but that depends on who manufactured the bulb and what gas they trapped inside your particular bulb. Pure white is usually around 6000 Kel.
I know this was a bit verbose but I'm sure you wanted to hear the truth and maybe understand why.