whatisgithub

What is foil-shaders?

reidbarber/foil-shaders — explained in plain English

Analysis updated 2026-05-18

3SwiftAudience · developerComplexity · 2/5LicenseSetup · easy

In one sentence

A SwiftUI library bringing animated Paper Shaders visual effects natively to iOS and macOS apps.

Mindmap

mindmap
  root((Foil Shaders))
    What it does
      Native Metal shaders
      Ports Paper Shaders
      SwiftUI components
    Tech stack
      Swift
      SwiftUI
      Metal
    Use cases
      Animated app backgrounds
      Mesh gradient effects
      Preview with companion app
    Audience
      iOS developers
      macOS developers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Add animated mesh gradient or swirl backgrounds to a SwiftUI iOS or macOS app.

USE CASE 2

Reuse existing Paper Shaders presets natively without a WebGL view.

USE CASE 3

Preview and tune shader effects visually using the companion Foil Shader Studio app.

USE CASE 4

Build accessibility conscious animated UI that respects the system Reduce Motion setting.

What is it built with?

SwiftSwiftUIMetal

How does it compare?

reidbarber/foil-shadersabdullahselek/swiftpusherbartosk97/dead-process-mate
Stars333
LanguageSwiftSwiftSwift
Last pushed2026-06-24
MaintenanceActive
Setup difficultyeasymoderateeasy
Complexity2/52/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Alpha, pre-1.0 status, so the API may still change before a stable release.

Apache 2.0 license: free to use, modify, and redistribute, including for commercial purposes, as long as you keep attribution notices.

So what is it?

Foil Shaders is a SwiftUI library that brings a collection of visual effects called Paper Shaders to iOS and macOS apps, using Apple's Metal graphics technology to run them efficiently on device. Paper Shaders is an existing set of animated visual effects like mesh gradients, swirls, dithering patterns, and paper textures, originally built for the web using WebGL. This project reimplements those same effects natively for Apple platforms so Swift developers can use them without relying on a web view. Developers add it to their project through Xcode's package manager or by editing their Package.swift file directly, pointing at the project's GitHub repository and a specific version number. Once installed, using an effect is as simple as adding a SwiftUI view like AnimatedMeshGradient with a few parameters for colors, distortion, and animation speed. Many effects also come with ready made presets copied from the original Paper Shaders project, and colors can be written as hex codes or in common formats like rgb and hsl. The animated components are considerate of accessibility and performance by default: they respect the system's Reduce Motion setting and pause rendering when the app is inactive or the view is offscreen, though developers can turn either behavior off for specific cases. There is also a companion desktop app, Foil Shader Studio, available as a separate download for browsing and previewing the shaders visually. The project includes a visual comparison system that checks its Metal based output against reference images from the original web based Paper Shaders project, to confirm the two look the same. The README notes this project is still in an early alpha stage before its first stable release, so its programming interface may still change. This is aimed at iOS and macOS developers who want polished, animated background effects in their SwiftUI apps. It is released under the Apache 2.0 license, allowing free use, modification, and redistribution, including commercially.

Copy-paste prompts

Prompt 1
Walk me through adding Foil Shaders to my SwiftUI project using Xcode's package manager.
Prompt 2
Show me how to use the AnimatedMeshGradient view with custom colors and animation speed.
Prompt 3
Explain how Foil Shaders handles the Reduce Motion accessibility setting by default.
Prompt 4
Help me understand the difference between using a preset like Swirl(.candy) and a flat initializer.
Prompt 5
What does this project's visual parity suite check compared to the original Paper Shaders project?

Frequently asked questions

What is foil-shaders?

A SwiftUI library bringing animated Paper Shaders visual effects natively to iOS and macOS apps.

What language is foil-shaders written in?

Mainly Swift. The stack also includes Swift, SwiftUI, Metal.

What license does foil-shaders use?

Apache 2.0 license: free to use, modify, and redistribute, including for commercial purposes, as long as you keep attribution notices.

How hard is foil-shaders to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is foil-shaders for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.