There are two green/purple wires going to the light assembly connector. One is for the tail light (lower half) and the other is for the brake (upper half). Why they used the same color code, I don't know. I turned on the tail lights and cut one of them to figure out which was which.
Remember to use diodes. The lights are controlled by the vehicle computer and they don't like to have electricity going the wrong way into them. A diode acts like a check valve; it only allows electricity to flow in one direction. To put a diode in, it is best quality to solder and heat shrink, but using butt splice connectors is easier. One end of the diode will have a ring on it. That end gets connected towards the lamp. Before hooking up the trailer wiring, test the diodes' polarity by trying out the lights. If one doesn't work, the polarity is backwards.
Here's a
picture. The 2nd one from the top is called a rectifier diode and it's the type you want.
RK