title: JavaScript color contraster
body: <p>I'm looking for a technique where we could programmatically pick the best color contrast to apply on text over HTML elements of different (unpredictable) background colors.</p>
  
  <p>Since the HTML elements will have different colors, we're looking for a technique that will be able to determine what is the color of the content behind the text, and then adapt the text's color to use the one with the best contrast.</p>
  
  <p>I'm quite sure this can't be CSS only, I've looked for Jquery solutions but couldn't find any... anyone has a clue?</p>
  
  <p><strong>[UPDATE] :</strong> 
  Based on the first replies, I guess I need to rephrase. Imagine that I'm building a image sharing service and I want to allow people to tag <em>on</em> the pictures themselves. The pictures can be of any color. How can I pick up the right color of the tags, for each different picture?</p>