彩色图案
示例
override func viewDidLoad() {
super.viewDidLoad()
let pastelView = PastelView(frame: view.bounds)
// Custom Direction
pastelView.startPastelPoint = .bottomLeft
pastelView.endPastelPoint = .topRight
// Custom Duration
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),
UIColor(red: 32/255, green: 76/255, blue: 255/255, alpha: 1.0),
UIColor(red: 32/255, green: 158/255, blue: 255/255, alpha: 1.0),
UIColor(red: 90/255, green: 120/255, blue: 127/255, alpha: 1.0),
UIColor(red: 58/255, green: 255/255, blue: 217/255, alpha: 1.0)])
pastelView.startAnimation()
view.insertSubview(pastelView, at: 0)
}
🎨 自定义渐变颜色
https://dribbble.com/anwaltzzz
由 Alexander Zaytsev 设计,要运行示例项目,请克隆仓库并首先从 Example 目录运行 pod install
。
要求
彩色图案是用 Swift 3+ 编写的。需要 iOS 8.0+
安装
彩色图案通过 CocoaPods 或 Carthage 提供。
Cocoapods
pod "Pastel"
Carthage
github "cruisediary/Pastel" ~> 0.5.1
示例
- Passcode:一个简单的使用RxSwift, ReactorKit, IGListKit和Pastel的Passcode应用程序
强大
- awesome-swift - 一份优秀的Swift库和资源的共享列表。欢迎贡献!
- awesome-gradient -
🌈 精选优秀梯度框架、库和软件及相关资源列表
作者
cruz, [email protected]
感谢
感谢本项目贡献者。
许可证
Pastel适用于MIT许可证。有关更多信息,请参阅LICENSE文件。