News for hackers. Stuff that matters.
Re:Calculating Color Contrast for Legible Text in Ruby by xhuang on Monday July 19, 2010 @06:08AM (#1528131)
This is ugly, but it should do the job:

"#000000" if sum([int(i,16) for i in re.findall("..",myColour)]) > 382.5 else "#ffffff"

There are no comments on this comment yet.