Skip to content

ArthurGuibert/SwiftUI-MulticolorGradient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

21 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

SwiftUI-MulticolorGradient

A SwiftUI implementation of multiple color gradient. Like mesh gradient, but with a simpler and a more declarative way to build it ๐ŸŒˆ

Usage

You can use it as a regular SwiftUI view:

MulticolorGradient {
   ColorStop(position: .top, color: .red)
   ColorStop(position: .bottomLeading, color: .blue)
   ColorStop(position: .topTrailing, color: .green)
}

You can add up to 8 color stops (or points). Animations have a basic support: only linear animations are supported for now.

Installation

Swift Package Manager

dependencies: [
    .package(url: "https://github.com/ArthurGuibert/SwiftUI-MulticolorGradient.git")
]

Requirements

  • iOS 15.0+
  • Xcode 14+

About

A SwiftUI implementation of multiple color gradient (like mesh gradient) ๐ŸŒˆ

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published