UIColor comparison

前端 未结 5 475
[愿得一人]
[愿得一人] 2020-12-17 06:04

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 c

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-17 06:53

    Proposed algorithm to calculate color / color brightness difference: http://maestric.com/doc/color_brightness_difference_calculator (based on w3c paper)

提交回复
热议问题