Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/exyte/AnimatedGradient


https://github.com/exyte/AnimatedGradient

Last synced: 6 days ago
JSON representation

Awesome Lists containing this project

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 AnimatedGradient

struct ContentView: View {
var body: some View {
AnimatedLinearGradient(colors: [.red, .green, .blue])
}
}
```

### With modifiers

```swift
import AnimatedGradient

struct 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