UIColor comparison

前端 未结 5 451
[愿得一人]
[愿得一人] 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 07:02

    here is a guide (with code provided) on UIColor expansion (using a category) and has methods such as get hexStringFromColor: It should be what you're looking for. UIColor expansion Note: I did not write this blog or code.

提交回复
热议问题