azymm
Re:Calculating Color Contrast for Legible Text in Ruby
on Monday July 26, 2010 @04:15PM (#1549128)
Ah, thank you very much for pointing that out!
Re:Calculating Color Contrast for Legible Text in Ruby
on Sunday July 18, 2010 @11:33PM (#1527520)
I also had to do something like this for my Python project and ended up with this:
'#000' if int(my_color, 16) > 0xffffff/2 else '#fff'
This approach isn't perfect, but it does the job.