Then import the SwiftColor packages wherever you’d like to use it:
import SwiftColor
Garbage in… Color out
The primary SwiftColor storage type is called Pigment. It stores RGBa information about a specific color and has many convenience initializers.
The goal is to be able to pass any sort of color-related value, and get a reasonable color out.
// Different ways to initialize with 'Blue'
_ = Pigment(blue: 1.0)
_ = Pigment(blue: 255)
_ = Pigment("blue")
_ = Pigment("#0000FF")
_ = Pigment(0x00F)
_ = Pigment(0x0000FF)
SwiftColor
A platform agnostic representation of Color.
Usage
SwiftColor is distributed using the Swift Package Manager. To install it into a project, add it as a dependency within your
Package.swift
manifest:Then import the SwiftColor packages wherever you’d like to use it:
Garbage in… Color out
The primary SwiftColor storage type is called
Pigment
. It stores RGBa information about a specific color and has many convenience initializers. The goal is to be able to pass any sort of color-related value, and get a reasonable color out.