Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/intitni/smoothgradient
Generate buttery smooth gradients.
https://github.com/intitni/smoothgradient
color gradient ios macos swift swiftui
Last synced: 3 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 (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-10-16T06:58:13.000Z (about 2 years ago)
- Last Synced: 2024-10-10T22:42:10.192Z (3 months ago)
- Topics: color, gradient, ios, macos, swift, swiftui
- Language: Swift
- Homepage: https://swiftpackageindex.com/intitni/SmoothGradient/main/documentation/smoothgradient
- Size: 132 KB
- Stars: 57
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SmoothGradient
![License](https://img.shields.io/github/license/intitni/SmoothGradient)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fintitni%2FSmoothGradient%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/intitni/SmoothGradient)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fintitni%2FSmoothGradient%2Fbadge%3Ftype%3Dplatforms)](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.
![Image](https://github.com/intitni/SmoothGradient/raw/main/Resources/Gradients.png)
## 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.