The story
This phrase may derive from a mediaeval custom at jousting matches. Knights are said to have worn the colours of the lady they were supporting, in cloths or ribbons tied to their arms. The term does not date from that period though, and is first recorded in Shakespeare's Othello, 1604, in which the treacherous Iago's plan was to feign openness and vulnerability in order to appear faithful.
Etymology from Wiktionary, CC BY-SA 4.0.