Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nikstar/swift-oklch
Oklch support for Swift
https://github.com/nikstar/swift-oklch
Last synced: about 1 month ago
JSON representation
Oklch support for Swift
- Host: GitHub
- URL: https://github.com/nikstar/swift-oklch
- Owner: nikstar
- Created: 2024-07-28T08:12:23.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-07-28T08:22:37.000Z (6 months ago)
- Last Synced: 2024-07-28T09:36:45.681Z (6 months ago)
- Language: Swift
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Oklch support for Swift
```swift
import SwiftUI
import Oklchlet color = Color.oklch(0.8, 0.35, .degress(230))
// nil for colors with different light and dark appearances such as `Color.red`
let maybeOklch: Oklch? = someColor.oklchlet oklch: Oklch = Color.red.resolved(in: env).oklch
let brighterColor = oklch.with { $0.lightness *= 1.15 }
```