The power is also taken from the nearest lamp, or you want the light bar to light up with which lamp, and take the power from which lamp.
If it lights up with the headlight, connect the headlight wire.
When it lights up with the brake light, connect the brake light wire.
When it lights up with the turning light, connect the turning light wire