Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/drewalth/trendygradients
SwiftUI ViewModifiers that apply super cool trendy animated or non-animated neon gradient backgrounds
https://github.com/drewalth/trendygradients
animation gradient neon swift swiftui trendy
Last synced: 9 days ago
JSON representation
SwiftUI ViewModifiers that apply super cool trendy animated or non-animated neon gradient backgrounds
- Host: GitHub
- URL: https://github.com/drewalth/trendygradients
- Owner: drewalth
- Created: 2023-05-25T16:01:28.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-12T20:28:21.000Z (5 months ago)
- Last Synced: 2024-06-14T01:23:16.344Z (5 months ago)
- Topics: animation, gradient, neon, swift, swiftui, trendy
- Language: Swift
- Homepage:
- Size: 3.51 MB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TrendyGradients
Super cool boxes with trendy neon gradient backgrounds for SwiftUI. Use the provided ViewModifiers or copy pasta and make your own :)
![photo](trendy-hero.gif)
## Installation
### Swift Package Manager
Add the following to your `Package.swift` file:
```swift
dependencies: [
.package(url: "https://github.com/drewalth/TrendyGradients.git", from: "2.0.0")
]
```## Usage
### ViewModifier - Default```swift
import TrendyGradientsstruct ContentView: View {
var body: some View {
VStack {
Text("Hello, World!")
.padding()
.background(TrendyGradient())
.cornerRadius(10)
.padding()
}.gradient(colors: (Color.pink, Color.purple))
}
}
```### ViewModifier - Animated
```swift
import TrendyGradientsstruct ContentView: View {
var body: some View {
VStack {
Text("Hello, World!")
.padding()
.background(TrendyGradient())
.cornerRadius(10)
.padding()
}.animatedGradient(colors1: [Color.red, Color.blue], colors2: [Color.green, Color.yellow])
}
}
```### ButtonStyle
```swift
import TrendyGradientsButton("Gradient Button") {
print("Button tapped")
}.gradientButton(colors: (Color.pink, Color.purple))
.foregroundColor(.white)
```