GCKColor Class
Stay organized with collections
Save and categorize content based on your preferences.
A class that represents an RGBA color.
Inherits NSObject, <NSCopying>, and <NSSecureCoding>.
|
CGFloat | red |
| The red intensity of the color; a value in the range [0.0, 1.0]. More...
|
|
CGFloat | green |
| The green intensity of the color; a value in the range [0.0, 1.0]. More...
|
|
CGFloat | blue |
| The blue intensity of the color; a value in the range [0.0, 1.0]. More...
|
|
CGFloat | alpha |
| The alpha (transparency) of the color; a value in the range [0.0, 1.0]. More...
|
|
- (instancetype) initWithRed: |
|
(CGFloat) |
red |
green: |
|
(CGFloat) |
green |
blue: |
|
(CGFloat) |
blue |
alpha: |
|
(CGFloat) |
alpha |
|
|
| |
Designated initializer.
Constructs a GCKColor object with the given red, green, blue, and alpha values. All color components are in the range [0.0, 1.0].
- (instancetype) initWithRed: |
|
(CGFloat) |
red |
green: |
|
(CGFloat) |
green |
blue: |
|
(CGFloat) |
blue |
|
|
| |
Constructs a GCKColor object with the given red, green, blue values and an alpha value of 1.0 (full opacity).
All color components are in the range [0.0, 1.0].
- (instancetype) initWithUIColor: |
|
(UIColor *) |
color |
|
Constructs a GCKColor object from a UIColor.
- (instancetype) initWithCGColor: |
|
(CGColorRef) |
color |
|
Constructs a GCKColor object from a CGColor.
Constructs a GCKColor object from a CGColor and a given alpha value.
- Since
- 4.0
- (instancetype) initWithCSSString: |
|
(NSString *) |
CSSString |
|
Constructs a GCKColor object from a CSS string representation in the form "#RRGGBBAA" or "#RRGGBB".
Returns a CSS string representation of the color, in the form "#RRGGBBAA".
The red intensity of the color; a value in the range [0.0, 1.0].
The green intensity of the color; a value in the range [0.0, 1.0].
The blue intensity of the color; a value in the range [0.0, 1.0].
The alpha (transparency) of the color; a value in the range [0.0, 1.0].
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["\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,[]]