A class that represents an RGBA color. More...

#import <GCKColor.h>

+ Inheritance diagram for GCKColor:

Instance Methods

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

Class Methods

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

Properties

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

Detailed Description

A class that represents an RGBA color.

Method Documentation

+ (GCKColor *) black

The color black.

+ (GCKColor *) blue

The color blue.

- (NSString *) CSSString

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

+ (GCKColor *) cyan

The color cyan.

+ (GCKColor *) green

The color green.

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

- (instancetype) initWithNSColor: (NSColor *)  color

Constructs a GCKColor object from an NSColor.

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

+ (GCKColor *) magenta

The color magenta.

+ (GCKColor *) red

The color red.

+ (GCKColor *) white

The color white.

+ (GCKColor *) yellow

The color yellow.

Property Documentation

- (CGFloat) alpha
readnonatomicassign

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

- (CGFloat) blue
readnonatomicassign

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

- (CGFloat) green
readnonatomicassign

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

- (CGFloat) red
readnonatomicassign

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


The documentation for this class was generated from the following file: