Latest 1.3.0
License MIT
Platforms ios 9.0, requires ARC





⭐️ Features

  • [x] Beautiful, automatically generated gradients from uiGradients in Swift.
  • [x] Smoothly animating, randomizable gradient views.
  • [x] Life is like a box of chocolates.

📋 Requirements

iOS 9 & Swift 4 / 5.

📲 Installation


To install Randient using CocoaPods, add this line to your Podfile:

pod 'Randient'


To install Randient using Carthage, add this line to your Cartfile:

github "Randient"

🚀 Usage

Gradient Roulette

RandientView is a simple view that will display a randomly selected gradient from the uiGradients catalog.

let randientView = RandientView()
randientView.frame = CGRect(x: 0, y: 0, width: 100, height: 100)

Updating to a new gradient is as simple as…

randientView.randomize(animated: true)

Those wonderful gradients

An enum of all the gradients from uiGradients is generated every time that Randient is built.

These are available as an enum via UIGradient.

let gradient = UIGradient.royalBlue
let colors =

If you’re feeling lucky, a randomized UIGradient can also be retrieved.

let randomGradient = Randient.randomize()

The raw stuff

Each UIGradient has associated Data which can be accessed via .data.

struct Data {
    public let name: String
    public let colors: [UIColor]

Metadata is also available, accessible via .metadata.

struct Metadata {
    public let isPredominantlyLight: Bool

Gradient View

RandientView inherits from GradientView, which under the hood uses simply uses a CAGradientLayer for rendering gradients.

GradientView provides the following:

  • .colors: [UIColor]? – Colors of the gradient.
  • .locations: [Double]? – Locations of each gradient stop.
  • .startPoint: CGPoint – Start point of the gradient (Defaults to 0.5, 0.0).
  • .endPoint: CGPoint – End point of the gradient (Defaults to 0.5, 1.0).

👨🏻‍💻 About

❤️ Contributing

Bug reports and pull requests are welcome on GitHub at

👮🏻‍♂️ License

The library is available as open source under the terms of the MIT License.

Latest podspec

    "name": "Randient",
    "platforms": {
        "ios": "9.0"
    "swift_version": "4.0",
    "requires_arc": true,
    "version": "1.3.0",
    "summary": "Radient, random gradient views.",
    "description": "Randomizable, animated gradients generated from",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "UI At Six": "[email protected]"
    "social_media_url": "",
    "source": {
        "git": "",
        "tag": "1.3.0"
    "source_files": [
    "prepare_command": "./Scripts/ ./Sources"

Pin It on Pinterest

Share This