How do i get the hue, saturation and brightness from a UIColor?

后端 未结 3 1503
挽巷
挽巷 2021-01-14 21:56

I want to get the individual values from a UIColor. Unsure how to do it?

3条回答
  •  无人共我
    2021-01-14 22:10

    At the bottom of Dustin's algorithm, he mentions all UIColor objects in iOS 5 and later now have

    getHue:saturation:brightness:alpha:
    

    This makes it very easy to get the values from a color. This is definitely the easiest solution now, and most everyone is on iOS 5.

提交回复
热议问题