Quantcast
Channel: Controls – TAGTECINFO
Viewing all articles
Browse latest Browse all 336

[iOS App Dev Libraries, Controls, Tutorials, Examples and Tools]Swift Library For Easily Generating Color Palettes From An Image

$
0
0

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 image = UIImage(named: "hello.png")
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:


UIImageColors

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


Viewing all articles
Browse latest Browse all 336

Trending Articles