Unfortunately, manufactures are free to use any color wire they want, so it's a crapshoot as to what wire goes to what ring.
However, there are a couple of things we can do to try and figure out what's what. First, knowing the make and model of your headphones would help us in possibly finding either wiring diagrams or previous users' experience with the wiring to the plug.
Personally, what I'd try would be to see if I could figure it out from disassembling the broken connector and determine which wire is connected where.
The only other suggestion I have would be to first figure out what each of the rings and the tip does based on what it's plugged into, then open up the headphones and find out where each of the wires goes. For example, you'll probably have left and right speakers, and presumably a microphone. If you can find out which color wire goes to each of those components inside the headphones, that would go a long way toward puzzling out how to wire a replacement jack.