GCKColor 类
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
继承 NSObject、<NSCopy> 和 <NSSecureCoding>。
|
CGFloat | red |
| 颜色的红色强度;介于 [0.0, 1.0] 之间的值。更多...
|
|
CGFloat | green |
| 颜色的绿色强度;介于 [0.0, 1.0] 之间的值。更多...
|
|
CGFloat | blue |
| 颜色的蓝色强度;介于 [0.0, 1.0] 范围内的值。更多...
|
|
CGFloat | alpha |
| 颜色的 Alpha(透明度);一个介于 [0.0, 1.0] 之间的值。更多...
|
|
- (instancetype) initWithRed: |
|
(CGFloat) |
red |
green: |
|
(CGFloat) |
green |
blue: |
|
(CGFloat) |
blue |
alpha: |
|
(CGFloat) |
alpha |
|
|
| |
指定的初始化程序。
使用指定的 red、green、blue 和 alpha 值构造 GCKColor 对象。所有颜色分量都在 [0.0, 1.0] 范围内。
- (instancetype) initWithRed: |
|
(CGFloat) |
red |
green: |
|
(CGFloat) |
green |
blue: |
|
(CGFloat) |
blue |
|
|
| |
使用指定的红色、绿色、蓝色值和 1.0(完全不透明度)的 alpha 值构造 GCKColor 对象。
所有颜色分量都在 [0.0, 1.0] 范围内。
- (instancetype) initWithUIColor: |
|
(UIColor *) |
color |
|
- (instancetype) initWithCGColor: |
|
(CGColorRef) |
color |
|
基于 CGColor 和给定的 Alpha 值构造 GCKColor 对象。
- 开始时间
- 4.0
- (instancetype) initWithCSSString: |
|
(NSString *) |
CSSString |
|
使用“#RRGGBBAA”或“#RRGGBB”形式的 CSS 字符串表示法构造 GCKColor 对象。
以“#RRGGBBAA”的形式返回颜色的 CSS 字符串表示法。
颜色的红色强度;介于 [0.0, 1.0] 之间的值。
颜色的绿色强度;介于 [0.0, 1.0] 之间的值。
颜色的蓝色强度;介于 [0.0, 1.0] 范围内的值。
颜色的 Alpha(透明度);一个介于 [0.0, 1.0] 之间的值。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eThe \u003ccode\u003eGCKColor\u003c/code\u003e class represents an RGBA color, inheriting from \u003ccode\u003eNSObject\u003c/code\u003e, \u003ccode\u003eNSCopying\u003c/code\u003e, and \u003ccode\u003eNSSecureCoding\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIt provides various initializers to create colors from RGBA values, \u003ccode\u003eUIColor\u003c/code\u003e, \u003ccode\u003eCGColor\u003c/code\u003e, and CSS strings.\u003c/p\u003e\n"],["\u003cp\u003eClass methods offer convenient access to predefined colors like black, red, green, blue, cyan, magenta, yellow, and white.\u003c/p\u003e\n"],["\u003cp\u003eProperties \u003ccode\u003ered\u003c/code\u003e, \u003ccode\u003egreen\u003c/code\u003e, \u003ccode\u003eblue\u003c/code\u003e, and \u003ccode\u003ealpha\u003c/code\u003e allow access to the color components.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eCSSString\u003c/code\u003e instance method provides a CSS string representation of the color.\u003c/p\u003e\n"]]],["The `GCKColor` class represents an RGBA color. Key actions include initializing `GCKColor` objects using red, green, blue, and alpha values; from `UIColor` or `CGColor`; or from CSS strings (#RRGGBBAA or #RRGGBB). Methods return a CSS string representation of the color and allow initialization with an alpha value. Class methods provide predefined colors like black, red, green, blue, cyan, magenta, yellow, and white. Properties represent red, green, blue, and alpha intensities within the range [0.0, 1.0].\n"],null,[]]