Skip to content

Commit

Permalink
Add PastelGradient setter to PastelView
Browse files Browse the repository at this point in the history
  • Loading branch information
cruisediary committed May 18, 2017
1 parent d04fa47 commit 7ff80a1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions Example/Pastel/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class ViewController: UIViewController {
pastelView.animationDuration = 3.0

// Custom Color

pastelView.setColors([UIColor(red: 156/255, green: 39/255, blue: 176/255, alpha: 1.0),
UIColor(red: 255/255, green: 64/255, blue: 129/255, alpha: 1.0),
UIColor(red: 123/255, green: 31/255, blue: 162/255, alpha: 1.0),
Expand Down
2 changes: 1 addition & 1 deletion Pastel/Classes/PastelGradient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import UIKit

@objc enum PastelGradient: Int {
@objc public enum PastelGradient: Int {
case warmFlame
case nightFade
case springWarmth
Expand Down
4 changes: 4 additions & 0 deletions Pastel/Classes/PastelView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ open class PastelView: UIView {
self.colors = colors
}

public func setPastelGradient(_ gradient: PastelGradient) {
setColors(gradient.colors())
}

public func addcolor(_ color: UIColor) {
self.colors.append(color)
}
Expand Down

0 comments on commit 7ff80a1

Please sign in to comment.