Description
Pastel is a Swift library for iOS that adds an animated gradient, similar to the one used in the Instagram app, to SwiftUI and UIKit views. It can be used as a background, as a fill for a view, or as a gradient in text. It includes 30 built-in gradient presets from the PastelGradient type, and you can also define your own colours. Several views can share one gradient state, so their colours change together. The library requires iOS 16 or later, Swift 5.9 or later and Xcode 15 or later. You install it with the Swift Package Manager, by adding it to Package.swift or through Xcode's package dependencies, or with CocoaPods. The repository includes an example project that links Pastel through the Swift Package Manager. The presets were designed by Alexander Zaytsev, and the author thanks the contributors. Pastel is available under the MIT license.…
Highlights
- Animated gradient backgrounds and text
- SwiftUI and UIKit support
- 30 built-in gradient presets
- Shared state across several views
- MIT licensed
Ratings & Reviews
No ratings yet
Be the first to rate Pastel.
People also visit
JDFlipNumberView
[iOS] Animated analog flip numbers like airport/train-station displays
Pastel FAQ
What is Pastel?
A Swift library that adds Instagram-style animated gradients to iOS views.
Which iOS version does it need?
iOS 16 or later, with Swift 5.9 or later and Xcode 15 or later.
How do I install it?
With Swift Package Manager, through Package.swift or Xcode's package dependencies, or with CocoaPods.
Can I use my own colours?
Yes. The README shows custom colour examples as well as the 30 presets.
Does it work with UIKit?
Yes. The README includes UIKit usage, including shared state.
What license is it under?
MIT, as the README states.
What are the best Pastel alternatives?
Popular alternatives to Pastel include Pow, Pulsator and Twinkle. See all Pastel alternatives



