SkillAgentSearch skills...

Rainbows

A Metal-backed, blazingly fast alternative to CAGradientLayer.

Install / Use

/learn @regexident/Rainbows
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

jumbotron

Rainbows

Rainbows is a Metal-backed alternative to CAGradientLayer that is incredibly fast. It provides drawing of axial (aka "linear"), radial (aka "circular"), sweep (aka "angular" aka "conical") and even trippy spiral gradients at no less than 60fps.

screencast

Usage

Let's say you want to add a trippy noir spiral gradient to your view:

import Rainbows

let gradientLayer = GradientLayer()
gradientLayer.gradient = Gradient(colors: [
    UIColor.black.cgColor, UIColor.white.cgColor
])
gradientLayer.configuration = .spiral(
    center: CGPoint(x: 0.5, y: 0.5),
    angle: 0.0 * CGFloat.pi * 2.0,
    scale: 1.0
)
gradientLayer.frame = view.layer.bounds
view.layer.addSublayer(gradientLayer)

Or just skip the detour via self.layer and use a convenient GradientView:

import Rainbows

let gradientView = GradientView()
gradientView.gradient = Gradient(colors: [
    UIColor.black.cgColor, UIColor.white.cgColor
])
gradientView.configuration = .spiral(
    center: CGPoint(x: 0.5, y: 0.5),
    angle: 0.0 * CGFloat.pi * 2.0,
    scale: 1.0
)

Installation

The recommended way to add Rainbows to your project is via Carthage:

github 'regexident/Rainbows'

License

Rainbows is available under the MPL-2.0 license. See the LICENSE file for more info.

View on GitHub
GitHub Stars97
CategoryDevelopment
Updated1mo ago
Forks6

Languages

Swift

Security Score

100/100

Audited on Feb 24, 2026

No findings