CGColorGetComponents()返回什么? [英] What does CGColorGetComponents() return?
问题描述
CGFloat* colors = CGColorGetComponents(hsbaColor.CGColor);
这是否返回一个浮点数或浮点数组?看起来星号是创建数组的简写。这是正确的吗?
Does this return a float, or an array of floats? It looks like the asterisk is shorthand for creating an array. Is that correct?
当我在HSB UIColor对象的CGColor属性上调用这个函数时,它将值转换为RGB?
When I call this function on the CGColor property of an HSB UIColor object does it convert the values to RGB?
推荐答案
是的,它返回一个 CGFloats
的数组。具体地,它返回与指定颜色相关联的颜色分量(包括α)的强度值数组。
Yes, it returns an array of CGFloats
. Specifically, it returns "an array of intensity values for the color components (including alpha) associated with the specified color."
返回的颜色分量取决于什么颜色空间
The color components returned depend on what color space the passed CGColorRef
uses.
More information can be found in the CGColor documentation.
这篇关于CGColorGetComponents()返回什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!