CGColorGetComponents()返回什么? [英] What does CGColorGetComponents() return?

查看:178
本文介绍了CGColorGetComponents()返回什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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.

更多信息可以在 apple.com/library/ios/documentation/graphicsimaging/Reference/CGColor/Reference/reference.html#//apple_ref/c/func/CGColorGetComponentsrel =nofollow noreferrer> CGColor文档

More information can be found in the CGColor documentation.

这篇关于CGColorGetComponents()返回什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆