richardpiazza/swiftcolor
A platform agnostic representation of Color.
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.
``swift // Different ways to initialize with 'Blue' = Pigment(blue: 1.0) = Pigment(blue: 255) = Pigment("blue") = Pigment("#0000FF") = Pigment(0x00F) = Pigment(0x0000FF) ``
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:
let package = Package(
...
dependencies: [
.package(url: "https://github.com/richardpiazza/SwiftColor.git", from: "0.3.0")
],
...
)Then import the SwiftColor packages wherever you'd like to use it:
import SwiftColorPackage Metadata
Repository: richardpiazza/swiftcolor
Default branch: main
README: README.md