Open Source Library to Find the Nearest Color Name for Color and UIColor.
For installation with Swift Package Manager, add the following to Package.swift
:
.package(url: "https://github.com/ProjectInTheClass/Name4RGB", from: "0.1.0")
You can easily find find name of Color, localized color names by specifying the language and region.
let color = Color(red: 0.4, green: 0.4, blue: 0.4)
print(color.name()) // dimgray
print(color.name("en-GB")) // dimgrey
let uiColor = UIColor(red: 0.4, green: 0.4, blue: 0.4, alpha: 1.0)
print(uiColor.name()) // dimgray
print(uiColor.name("en-GB")) // dimgrey
Distributed under the MIT License. See LICENSE
for more information.