Colour fetching for UIImage
to find the most dominant colour. This was inspired by jathu's UIImageColors.
let image = UIImage(named: "")
if let uiImageColour = image.analyzeImage() {
let primaryColour = uiImageColour.dominantColor
} else {
print("Failed to analyze the image.")
}
- File > Swift Packages > Add Package Dependency
- Add
https://github.com/ca13ra1/UIImageColour.git