Livable is a SwiftUI package that turns a view's own pixels into a soft, animated, liquid-like gradient surface. The effect is implemented with a SwiftUI layer shader and Metal, so it can be applied directly to any SwiftUI view without extracting colors or providing a separate palette.
- iOS 17+
Add Livable as a Swift Package dependency in Xcode, or add it to your
Package.swift dependencies:
.package(url: "https://github.com/whatsinlab/livable.git", from: "0.1.0")Then add Livable to the target that uses the effect.
Import Livable and apply the modifier to any SwiftUI view:
import Livable
import SwiftUI
struct ContentView: View {
var body: some View {
Image("Artwork")
.resizable()
.aspectRatio(contentMode: .fit)
.livable()
}
}You can control whether the effect renders, how quickly it moves, and how much post-process blur is applied:
SomeView()
.livable(isEnabled: true, speed: 0.8, blurRadius: 48)The effect renders inside the modified view's layout bounds. To use it as a full-screen backdrop, give the source view a full-screen frame at the call site.
Livable is available under the MIT License.