Better HN
topnewbestaskshowjobs
Log inSign up

azymm

1 karma · joined May 17, 2010 (16y ago) · 2 submissions

Submissions

comment 16y ago · link · parent

Ah, thank you very much for pointing that out!

comment 16y ago · link · parent

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.