Earlier this year I mentioned a handy Swift library called Hue with a number of nice features such as easy creation of gradients.
Here’s an open source Swift library called UIImageColors from jathu that allows you to easily create a simple color palette from an image similar to how iTunes fetches colors based on an album cover.
UIImageColors features a very simple syntax, and this code example shows how to gather colors from an image:
let colors = image.getColors()
backgroundView.backgroundColor = colors.backgroundColor
mainLabel.textColor = colors.primaryColor
secondaryLabel.textColor = colors.secondaryColor
detailLabel.textColor = colors.detailColor
Here is an image from a readme showing some images and the palettes generated from them:
You can find UIImageColors on Github here.
A nice Swift library for easily creating color palettes based on an image.
Original article: Swift Library For Easily Generating Color Palettes From An Image
©2016 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.
Reference source: iOS App Dev Libraries, Controls, Tutorials, Examples and Tools