Given a UIColor, I need to determine if it is “light” or “dark”. If I could access the hex value of the color, I could just check if it was greater than or less than a certain threshold hex number, but there appears to be no way to do that. Is there? Or is there another way I could check the brightness value of a UIColor?
Share
You could install this Category for extending
UIColorfor knowing HSV/HSB and compare[aUIColor brightness]Edit:
I found the same code in some github-hosted project, made a gist of it: https://gist.github.com/1252197