IGGradientBrush Class Reference

Inherits from IGBrush : NSObject
Declared in Core.h

Overview

IGGradientBrush is a brush with multiple colors that form a gradient. The gradient begins with the brush added at offset 0.0 and ends with the brush added at offset 1.0. Additional brushes can be added at offsets between 0 and 1 to add multple colors to the gradient.

– addColorStopWithOffset:r:g:b:alpha:

Adds a new brush from red, green, blue, and alpha components at a specified offset. All parameters of this method are between 0 and 1.

- (void)addColorStopWithOffset:(double)offset r:(CGFloat)r g:(CGFloat)g b:(CGFloat)b alpha:(CGFloat)alpha

Parameters

offset

Position of the brush within the gradient. This value should be between 0 and 1.

r

Red component of the brush. This value should be between 0 and 1.

g

Green component of the brush. This value should be between 0 and 1.

b

Blue component of the brush. This value should be between 0 and 1.

alpha

Alpha component of the brush. This value should be between 0 and 1.

Declared In

Core.h

– addColorStopWithOffset:brush:

Adds a new IGBrush at a specified offset to the gradient.

- (void)addColorStopWithOffset:(double)offset brush:(IGBrush *)brush

Parameters

offset

Position of the brush within the gradient. This value should be between 0 and 1.

brush

IGBrush that will be added to the gradient.

Declared In

Core.h

  colors

Returns all of the colors added to the brush.

@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSArray<__kindofUIColor*> *colors

Declared In

Core.h

  gradientComponents

Returns an array of floats representing all gradient colors.

@property (NS_NONATOMIC_IOSONLY, readonly) CGFloat *gradientComponents

Declared In

Core.h

  gradientStops

Returns all gradient stops in the brush.

@property (NS_NONATOMIC_IOSONLY, readonly) CGFloat *gradientStops

Declared In

Core.h