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

后端 未结 3 1531
挽巷
挽巷 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:19

    There's a function called HSL2RGB() in the GLPaint sample code from Apple that'll do what you want. A comment above the function points you to Wikipedia for an explanation of the code, which may help you understand what's going on.

提交回复
热议问题