Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 25th, 2012  |  syntax: None  |  size: 0.14 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Algorithm to get best text color
  2. textColor = brightness(backColor) > 0.5 ? black : white;
  3.        
  4. brightness(R,G,B) = 0.299*R + 0.587*G + 0.114*B