https://github.com/intitni/smoothgradient
Generate buttery smooth gradients.
https://github.com/intitni/smoothgradient
color gradient ios macos swift swiftui
Last synced: 5 months ago
JSON representation
Generate buttery smooth gradients.
- Host: GitHub
- URL: https://github.com/intitni/smoothgradient
- Owner: intitni
- License: mit
- Created: 2021-03-02T04:48:35.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-10-16T06:58:13.000Z (over 2 years ago)
- Last Synced: 2025-01-31T10:11:35.155Z (5 months ago)
- Topics: color, gradient, ios, macos, swift, swiftui
- Language: Swift
- Homepage: https://swiftpackageindex.com/intitni/SmoothGradient/main/documentation/smoothgradient
- Size: 132 KB
- Stars: 60
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SmoothGradient

[](https://swiftpackageindex.com/intitni/SmoothGradient)
[](https://swiftpackageindex.com/intitni/SmoothGradient)SmoothGradient helps you generate beautiful and buttery-smooth gradients. It helps you avoid gray dead zones in the middle of your gradients by interpolating colors in color spaces other than RGB.
This is a package strongly inspired by this [gradient generator](https://learnui.design/tools/gradient-generator.html). You can click into the link to learn how this works.

## Usage
```swift
let colors: [UIColor] = SmoothGradientGenerator()
.generate(
from: fromColor,
to: toColor,
interpolation: .hcl, // choose from hcl, hsl, hsb
precision: .high
)
```Please check example playgrounds for more detail.
## Installation
### Swift Package Manager
Simply add `https://github.com/intitni/SmoothGradient` as a dependency in either Xcode or Package.swift.
## License
MIT.