GCKColor Class

GCKColor Class Reference

Overview

A class that represents an RGBA color.

Inherits NSObject, <NSCopying>, and <NSSecureCoding>.

Instance Method Summary

(instancetype) 
Designated initializer. More...
(instancetype) 
Constructs a GCKColor object with the given red, green, blue values and an alpha value of 1.0 (full opacity). More...
(instancetype) 
Constructs a GCKColor object from a UIColor. More...
(instancetype) 
Constructs a GCKColor object from a CGColor. More...
(instancetype) 
Constructs a GCKColor object from a CGColor and a given alpha value. More...
(instancetype) 
Constructs a GCKColor object from a CSS string representation in the form "#RRGGBBAA" or "#RRGGBB". More...
(NSString *) 
Returns a CSS string representation of the color, in the form "#RRGGBBAA". More...

Class Method Summary

( GCKColor *) 
The color black. More...
( GCKColor *) 
+ red
The color red. More...
( GCKColor *) 
The color green. More...
( GCKColor *) 
+ blue
The color blue. More...
( GCKColor *) 
+ cyan
The color cyan. More...
( GCKColor *) 
The color magenta. More...
( GCKColor *) 
The color yellow. More...
( GCKColor *) 
The color white. More...

Property Summary

CGFloat 
red
The red intensity of the color; a value in the range [0.0, 1.0]. More...
CGFloat 
The green intensity of the color; a value in the range [0.0, 1.0]. More...
CGFloat 
The blue intensity of the color; a value in the range [0.0, 1.0]. More...
CGFloat 
The alpha (transparency) of the color; a value in the range [0.0, 1.0]. More...

Method Detail

- (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.

- (instancetype) initWithCGColor: (CGColorRef)  color
alpha: (CGFloat)  alpha

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".

- (NSString *) CSSString

Returns a CSS string representation of the color, in the form "#RRGGBBAA".

+ ( GCKColor *) black

The color black.

+ ( GCKColor *) red

The color red.

+ ( GCKColor *) green

The color green.

+ ( GCKColor *) blue

The color blue.

+ ( GCKColor *) cyan

The color cyan.

+ ( GCKColor *) magenta

The color magenta.

+ ( GCKColor *) yellow

The color yellow.

+ ( GCKColor *) white

The color white.

Property Detail

- (CGFloat) red
read nonatomic assign

The red intensity of the color; a value in the range [0.0, 1.0].

- (CGFloat) green
read nonatomic assign

The green intensity of the color; a value in the range [0.0, 1.0].

- (CGFloat) blue
read nonatomic assign

The blue intensity of the color; a value in the range [0.0, 1.0].

- (CGFloat) alpha
read nonatomic assign

The alpha (transparency) of the color; a value in the range [0.0, 1.0].

Create a Mobile Website
View Site in Mobile | Classic
Share by: