Inherits from AKImageEffect : NSObject
Declared in AKGradientImageEffect.h
AKGradientImageEffect.m

Overview

The AKGradientImageEffect draws a gradient, either vertical or horizontal, between at least two intermediate colors.

Tasks

Creating a Gradient Image Effect

Customizing Appearance

  •   colors

    An array of UIColor objects for the gradient. Must be at least two.

    property
  •   direction

    The direction to draw the gradient in. Defaults to AKGradientDirectionVertical.

    property
  •   locations

    An array of NSNumber objects with values between 0 and 1. Represents the location along the gradient for the color at the corresponding index. If nil, the colors are spaced evenly.

    property

Properties

colors

An array of UIColor objects for the gradient. Must be at least two.

@property (readonly) NSArray *colors

Declared In

AKGradientImageEffect.h

direction

The direction to draw the gradient in. Defaults to AKGradientDirectionVertical.

@property (readonly) AKGradientDirection direction

Declared In

AKGradientImageEffect.h

locations

An array of NSNumber objects with values between 0 and 1. Represents the location along the gradient for the color at the corresponding index. If nil, the colors are spaced evenly.

@property (readonly) NSArray *locations

Declared In

AKGradientImageEffect.h

Instance Methods

initWithAlpha:blendMode:colors:direction:locations:

The designated initializer for a gradient image effect.

- (id)initWithAlpha:(CGFloat)alpha blendMode:(CGBlendMode)blendMode colors:(NSArray *)colors direction:(AKGradientDirection)direction locations:(NSArray *)locations

Parameters

alpha

The value for the alpha property.

blendMode

The value for the blendMode property.

colors

The value for the colors property.

direction

The value for the direction property.

locations

The value for the locations property.

Return Value

An initialized image effect.

Declared In

AKGradientImageEffect.h