Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Lakr233/ColorVector
Color with its space, in Swift.
https://github.com/Lakr233/ColorVector
Last synced: 3 months ago
JSON representation
Color with its space, in Swift.
- Host: GitHub
- URL: https://github.com/Lakr233/ColorVector
- Owner: Lakr233
- License: mit
- Created: 2024-07-03T17:34:16.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-07-04T10:29:49.000Z (6 months ago)
- Last Synced: 2024-07-05T22:59:13.547Z (6 months ago)
- Language: Swift
- Size: 10.7 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ColorVector
Used for color with conversion between different color spaces.
## Platform
Works on `Foundation` available devices. Should work on all Swift supported platforms.
## Usage
Add this package into your project.
```swift
dependencies: [
.package(url: "https://github.com/Lakr233/ColorVector.git", from: "1.0.0"),
]
```Then you can use it like this:
```swift
import ColorVectorlet colorVectorRGB = ColorVector(v: .init(
Double.random(in: 0 ... 255),
Double.random(in: 0 ... 255),
Double.random(in: 0 ... 255),
Double.random(in: 0 ... 1)
), space: .rgb)
let someLCHColor = colorVectorRGB.lch
let someLABColor = colorVectorRGB.lab
let someXYZColor = colorVectorRGB.xyz
```## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
---
Copyright © 2023 Lakr Aream. All Rights Reserved.