toddheasley / hex

Mix color using hex values

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hex

Mix color using hex values in SwiftUI, UIKit and AppKit.

Requirements

Targets iOS/iPadOS/tvOS 14, watchOS 7 and macOS 11 Big Sur. Written in Swift 5.6 and requires Xcode 13.3 or newer to build.

Example Usage

import SwiftUI
import Hex

let _: [Color] = [
    Color(hex: "FFFFFF"),
    Color(hex: "#ccc", opacity: 0.9),
    Color(hex: 0x0000CC)
]

Plus, get the hex value of any color constructed from HSB, RGB or hex values:

print(Color(red: 0.0, green: 0.0, blue: 0.8).hex) // 0x0000CC
print(Color(white: 0.8).hexString) // "#CCCCCC"

About

Mix color using hex values

License:MIT License


Languages

Language:Swift 100.0%