Skip to content

rafael-b-g/PaperShaders

Repository files navigation

PaperShaders

Swift 6 iOS 17+ macOS 14+ tvOS 17+ visionOS 1+
X/Twitter

A SwiftUI library that adds paper-like visual effects to views using Metal shaders.

Banner

Installation

Add this package to your Xcode project (File > Add Package Dependencies), using this URL: "https://github.com/rafael-b-g/PaperShaders.git".

Usage

Start by importing the package: import PaperShaders

Paper texture (grain)

You can add paper grain using this modifier:

YourView()
    .paperTexture()

Paper distortion (ink effect)

You can add print distortion (simulating ink printed on paper) using this modifier:

YourView()
    .paperDistortion()

Tip

You can adjust the effects with optional parameters inside each modifier.

Demo

This repository also includes PaperShadersDemo, a small (and very fun) demo app for previewing the shaders and tweaking their parameters.

About

Paper-like visual effects for SwiftUI, using Metal shaders.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors