Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 705 Bytes

README.md

File metadata and controls

31 lines (20 loc) · 705 Bytes

Backpack/Gradient

Usage

BPKGradient/Backpack.Gradient contains the Backpack gradient definitions. Each instance has the four properties:

  • colors
  • stops
  • startPoint
  • endPoint

To render gradients BPKGradientView/Backpack.GradientView or BPKGradientLayer/Backpack.GradientLayer can be used.

Objective-C

#import <Backpack/Gradient.h>

BPKGradient *gradientDefault = [BPKGradient primary];
BPKGradient *gradientTopRight =  [BPKGradient primaryWithDirection:BPKGradientDirectionTopRight];

Swift

import Backpack

let gradientDefault = Backpack.Gradient.primary()
let gradientTopRight = Backpack.Gradient.primary(direction: .topRight)