Inherits from NSObject
Conforms to NSCopying
Declared in SGridGradient.h
Availability
Related samples

Overview

An SGridGradient is a simple immutable container class for holding the colors and locations of a gradient. These are applied to the colors and locations properties of a CAGradientLayer.

Tasks

  • + gradientWithColors:locations:

    Create an autoreleased gradient with the given color and location arrays.

  • – initWithColors:locations:

    Create a gradient with the given color and location arrays.

  •   colors

    A readonly array of CGColorRef objects defining the color of each gradient stop.

    property
  •   locations

    A readonly array of NSNumber objects defining the location of each gradient stop as a value in the range [0, 1]. The values must be monotonically increasing. If a nil array is given, the stops are assumed to spread uniformly across the [0,1] range.

    property

Properties

colors

A readonly array of CGColorRef objects defining the color of each gradient stop.

@property (nonatomic, retain, readonly) NSArray *colors

Declared In

SGridGradient.h

locations

A readonly array of NSNumber objects defining the location of each gradient stop as a value in the range [0, 1]. The values must be monotonically increasing. If a nil array is given, the stops are assumed to spread uniformly across the [0,1] range.

@property (nonatomic, retain, readonly) NSArray *locations

Declared In

SGridGradient.h

Class Methods

gradientWithColors:locations:

Create an autoreleased gradient with the given color and location arrays.

+ (id)gradientWithColors:(NSArray *)colors locations:(NSArray *)locations

Discussion

Warning: Important The number of colors must match the number of locations.

Declared In

SGridGradient.h

Instance Methods

initWithColors:locations:

Create a gradient with the given color and location arrays.

- (id)initWithColors:(NSArray *)colors locations:(NSArray *)locations

Declared In

SGridGradient.h