The phrase originates in Ireland.
Donkeys (or "asses" or "jackasses" as they are called in other parts of the world) do not naturally sit down on their rear ends. In fact, it is an extraordinary achievement to get one to do it.
"Talking the hind legs off a donkey" is a literal translation of the Gaelic, which actually means "making a donkey sit down on its rear end".
Thus, when a person can talk the hind legs off a donkey, they can talk so much that they could even bore a donkey into sitting down.
According to Wikipedia, the term:
reflects a theatrical superstition in which wishing a person "good luck" is considered bad luck. The expression is sometimes used outside the theatre as superstitions and customs travel through other professions and then into common use. Among professional dancers, the phrase "break a leg" is replaced with "merde".
The article goes on to mention several theories about the actual origins of this expression. The one that is often mentioned (as far as I have heard), is called the Opposite Meaning theory. It says,
People in theatre consider it bad luck to wish an actor good luck, so instead they wish the opposite, by saying "break a leg!".
Another theory claims that the phrase has Greek origins:
In the time of Ancient Greece, people didn't applaud. Instead, they stomped for their appreciation and if they stomped long enough, they would break a leg. Or, some would have it that the term originated during Elizabethan times when, instead of applause the audience would bang their chairs on the ground—and if they liked it enough, the leg of the chair would break.[12]
Still another claims that the origins are, in fact, Yiddish:
Some etymologists believe it to be an adaptation from the Yiddish translation into German. The phrase "Hatsloche un Broche" (הצלחה און ברכה) ("success and blessing") had been calqued from the German phrase "Hals- und Beinbruch" ("neck and leg fracture"), because of near similar pronunciation.
The Phrase Finder (hat tip to Unreason) has even more theories on how the term came to be. They note that:
'Break a leg' also means, 'make a strenuous effort'. There are many references to the phrase used that way, which pre-date the earliest theatrical good luck charm meaning.
So the theories they offer stem from this. For example, the following things could be related to "breaking a leg":
- Put on a performance good enough that you will have to bend your knee in a bow or curtsey to acknowledge the applause.
- Impress the audience so much that you will need to bend down to pick up the coins they throw onto the stage.
- Pass out onto the stage to receive a curtain call (the side curtains on a stage are known as legs).
- Go on stage and have your 'big break'.
Note that still, nobody knows the exact origin of the phrase, but some are more plausible than others.
Best Answer
The first definition in the OED is specific to diamond mining, where an off-colour diamond is neither pure white or another colour, which makes it of inferior value (there are quotations using the phrase from 1860 - 1968).
The next definition is more general and has two sub-definitions. The first means of a colour that's either darker, lighter, not natural, proper or acceptable (quoted 1873 - 2000). The second is to be slightly unwell, or not up to the mark, or out of order (1876 - 1997).
Finally, the third is what we're after:
The first quotation:
Searching Google Books, I found some antedatings. First for diamond mining:
The Mirror of Literature, Amusement, and Instruction - Volume 5 - Page 15 - John Timbs - 1825:
Next, for a general use (though I'm not sure if this means "unwell" or "of questionable taste"):
Paris in '67: Or, The Great Exposition, Its Side-shows and Excursions - Page 87 - Henry Morford - 1867: