GCKColor 类
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
继承 NSObject、<NSDuplicate> 和 <NSCoding>。
|
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 |
|
- (instancetype) initWithCSSString: |
|
(NSString *) |
CSSString |
|
使用“#RRGGBBAA”形式的 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 and inherits from \u003ccode\u003eNSObject\u003c/code\u003e, \u003ccode\u003eNSCopying\u003c/code\u003e, and \u003ccode\u003eNSCoding\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\u003eYou can access the red, green, blue, and alpha components as properties.\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\u003eThe \u003ccode\u003eCSSString\u003c/code\u003e method returns a CSS string representation of the color in the format \u003ccode\u003e#RRGGBBAA\u003c/code\u003e.\u003c/p\u003e\n"]]],["The GCKColor class represents an RGBA color. You can initialize GCKColor objects using red, green, blue, and alpha values, with the option to omit alpha for full opacity. It also allows construction from a UIColor, CGColor, or a CSS string. GCKColor can return its CSS string representation. Predefined color objects for black, red, green, blue, cyan, magenta, yellow, and white are available. The red, green, blue, and alpha properties can be accessed, ranging from 0.0 to 1.0.\n"],null,[]]