All Projects → joogps → IrregularGradient

joogps / IrregularGradient

Licence: MIT license
Create animated irregular gradients in SwiftUI.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to IrregularGradient

ScaledFont
ScaledFont - Using custom fonts with dynamic type
Stars: ✭ 50 (-60.63%)
Mutual labels:  tvos, watchos, swiftui
SwiftCurrent
A library for managing complex workflows in Swift
Stars: ✭ 286 (+125.2%)
Mutual labels:  tvos, watchos, swiftui
stinsen
Coordinators in SwiftUI. Simple, powerful and elegant.
Stars: ✭ 563 (+343.31%)
Mutual labels:  tvos, watchos, swiftui
WWDCNotes
WWDCNotes.com content
Stars: ✭ 343 (+170.08%)
Mutual labels:  tvos, watchos, swiftui
KeyboardKitPro
KeyboardKit Pro extends KeyboardKit with pro features.
Stars: ✭ 42 (-66.93%)
Mutual labels:  tvos, watchos, swiftui
Columbus
A feature-rich country picker for iOS, tvOS and watchOS.
Stars: ✭ 23 (-81.89%)
Mutual labels:  tvos, watchos, swiftui
TermiNetwork
🌏 A zero-dependency networking solution for building modern and secure iOS, watchOS, macOS and tvOS applications.
Stars: ✭ 80 (-37.01%)
Mutual labels:  tvos, watchos, swiftui
Skeletonui
☠️ Elegant skeleton loading animation in SwiftUI and Combine
Stars: ✭ 275 (+116.54%)
Mutual labels:  tvos, watchos, gradient
Swiftui Kit
A SwiftUI system components and interactions demo app
Stars: ✭ 1,733 (+1264.57%)
Mutual labels:  tvos, watchos, swiftui
Open Source Ios Apps
📱 Collaborative List of Open-Source iOS Apps
Stars: ✭ 28,826 (+22597.64%)
Mutual labels:  tvos, watchos, swiftui
QuoteKit
A framework to use the free APIs provided by https://quotable.io
Stars: ✭ 17 (-86.61%)
Mutual labels:  tvos, watchos, swiftui
Wwdc
You don't have the time to watch all the WWDC session videos yourself? No problem me and many contributors extracted the gist for you 🥳
Stars: ✭ 2,561 (+1916.54%)
Mutual labels:  tvos, watchos, swiftui
data-field
A SwiftUI view that wraps a text field to only accept specific data.
Stars: ✭ 13 (-89.76%)
Mutual labels:  tvos, watchos, swiftui
Orchard
Device identification in Swift and Objective-C for iOS, watchOS, and tvOS.
Stars: ✭ 15 (-88.19%)
Mutual labels:  tvos, watchos
Outlaw
JSON mapper for macOS, iOS, tvOS, and watchOS
Stars: ✭ 24 (-81.1%)
Mutual labels:  tvos, watchos
wwdc2018
You read my developer triceraptus migration notes from dub dub dc 2018
Stars: ✭ 48 (-62.2%)
Mutual labels:  tvos, watchos
articles-ko
Articles for NSHipster.co.kr
Stars: ✭ 18 (-85.83%)
Mutual labels:  tvos, watchos
RFKit
Toolkit for daily Cocoa development. Since 2012.
Stars: ✭ 20 (-84.25%)
Mutual labels:  tvos, watchos
Futures
Lightweight promises for iOS, macOS, tvOS, watchOS, and Linux
Stars: ✭ 59 (-53.54%)
Mutual labels:  tvos, watchos
SwiftBuilder
SwiftBuilder is a fast way to assign new value to the property of the object.
Stars: ✭ 26 (-79.53%)
Mutual labels:  tvos, watchos

IrregularGradient Project logo

Twitter: @joogps

A SwiftUI library for rendering beautiful, animated and irregular gradient views.

Installation

Since this is a Swift package, it can be installed via the Swift Package Manager. To do this, all you gotta do is open your Xcode project, add a new depedency under File > Add Packages, search for this repo and install it. Then, it's all done!

Usage

To add an irregular gradient to your app all you gotta do is add import IrregularGradient to the file you're using and then use the irregularGradient(colors: [Color], background: () -> View, shouldAnimate: Binding<Bool> = .constant(true), speed: Double = 10) modifier.

  • The first, required, argument colors specifies the colors of each blob. Order and amount matters, so the colors will be stacked in the order of the array on the Z axis. Having two entries of the same color will create two completely distinct blobs of that color.
  • The background argument defines the background of your gradient. It's a closure that returns a view, but can also just be a simple color if you use backgroundColor instead. Not specifying this value it will make the background clear.
  • shouldAnimate is a boolean that specifies whether or not the gradient blobs should move. It can be enabled and disabled dinamically, and movement will always slow down to a stop. The default value is true.
  • The speed argument accepts a Double and defines the speed of the movement – a 0.5 speed means the blobs will update every 2 seconds. The default value is 1.
RoundedRectangle(cornerRadius: 30.0, style: .continuous)
    .irregularGradient(colors: [.orange, .pink, .yellow, .orange, .pink, .yellow], backgroundColor: .orange)

You can also use the IrregularGradient standalone view, which exists in its own container.

Implementation

The current implementation of this package is done through the creation of blobs (SwiftUI's Ellipse shape) of the specified colors that move and scale randomly in the container, and are then blurred to achieve the desired effect.

Questions

If you have any questions or suggestions, you can create an issue or pull request on this GitHub repository or even contact me via Twitter or email.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].