Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/exyte/AnimatedGradient
https://github.com/exyte/AnimatedGradient
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/exyte/AnimatedGradient
- Owner: exyte
- License: mit
- Created: 2023-11-06T11:29:44.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-09T09:19:37.000Z (10 months ago)
- Last Synced: 2024-04-27T10:31:43.287Z (7 months ago)
- Language: Swift
- Size: 29.3 KB
- Stars: 19
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- fucking-awesome-swift - AnimatedGradient - Animated linear gradient library written with SwiftUI (Libs / Animation)
- awesome-swift - AnimatedGradient - Animated linear gradient library written with SwiftUI (Libs / Animation)
README
Animated Gradient
Animated linear gradient library written with SwiftUI
![](https://img.shields.io/github/v/tag/exyte/AnimatedGradient?label=Version)
[![License: MIT](https://img.shields.io/badge/License-MIT-black.svg)](https://opensource.org/licenses/MIT)# Usage
### Minimal example
```swift
import AnimatedGradientstruct ContentView: View {
var body: some View {
AnimatedLinearGradient(colors: [.red, .green, .blue])
}
}
```### With modifiers
```swift
import AnimatedGradientstruct ContentView: View {
var body: some View {
AnimatedLinearGradient(colors: [.red, .green, .blue])
.numberOfSimultaneousColors(2)
.setAnimation(.linear(duration: 5))
.gradientPoints(start: .bottomLeading, end: .topTrailing)
}
}
```### Required parameters - init
- `colors` - An array of colors between which the gradient will transition### Available customizations - modifiers
- `numberOfSimultaneousColors(Int)` - Number of colors on screen at any given time, can be more, equal or less than colors in the array
- `setAnimation(Animation)` - Animation of the transition of one color to another
- `gradientPoints(start:end:)` - Standard linear gradient control points### Presets
You can use preselected colors from GradientPreset for a quick start## Examples
To try AnimatedGradient examples:
- Clone the repo `https://github.com/exyte/AnimatedGradient.git`
- Open `Example.xcodeproj`
- Try it!## Installation
### [Swift Package Manager](https://swift.org/package-manager/)
```swift
dependencies: [
.package(url: "https://github.com/exyte/AnimatedGradient.git")
]
```## Requirements
* iOS 14.0+
## Our other open source SwiftUI libraries
[PopupView](https://github.com/exyte/PopupView) - Toasts and popups library
[Grid](https://github.com/exyte/Grid) - The most powerful Grid container
[ScalingHeaderScrollView](https://github.com/exyte/ScalingHeaderScrollView) - A scroll view with a sticky header which shrinks as you scroll
[AnimatedTabBar](https://github.com/exyte/AnimatedTabBar) - A tabbar with a number of preset animations
[MediaPicker](https://github.com/exyte/mediapicker) - Customizable media picker
[Chat](https://github.com/exyte/chat) - Chat UI framework with fully customizable message cells, input view, and a built-in media picker
[OpenAI](https://github.com/exyte/OpenAI) Wrapper lib for [OpenAI REST API](https://platform.openai.com/docs/api-reference/introduction)
[ConcentricOnboarding](https://github.com/exyte/ConcentricOnboarding) - Animated onboarding flow
[FloatingButton](https://github.com/exyte/FloatingButton) - Floating button menu
[ActivityIndicatorView](https://github.com/exyte/ActivityIndicatorView) - A number of animated loading indicators
[ProgressIndicatorView](https://github.com/exyte/ProgressIndicatorView) - A number of animated progress indicators
[FlagAndCountryCode](https://github.com/exyte/FlagAndCountryCode) - Phone codes and flags for every country
[SVGView](https://github.com/exyte/SVGView) - SVG parser
[LiquidSwipe](https://github.com/exyte/LiquidSwipe) - Liquid navigation animation