Hue
Hue is the all-in-one coloring utility that you'll ever need.
Usage
Hex
You can easily use hex colors with the
init(hex:)
convenience initializer on UIColor
. It supports the following hex formats #ffffff
, ffffff
, #fff
, fff
Computed color properties
Alpha
.alpha
is a sugar for colorWithAlphaComponent
, internally it does the exact same thing, think of it as a
lipstick for your implementation.
Gradients
You can easily create gradient layers using the gradient()
method on arrays with UIColor
.
As an extra bonus, you can also add a transform closure if you want to modify the CAGradientLayer
.
Image colors
Components
You can get red, green, blue, and alpha components from any UIColor by using the (red|green|blue|alpha)Component property.
Blending
Examples

Hex
This super simple example that displays a bunch of color schemes in a Carousel view.
It uses hex to set the color for the schemes. It leverages from .isDarkColor
to make the text color readable in all scenarios.
The demo also features Spots for rendering the Carousel view.
Example code:
Gradients

This examples shows how much fun you can have with combining CAGradientLayer
with CABasicAnimation
.
It uses .hex
for getting the colors and .gradient()
for transforming
a collection of UIColor
's into a CAGradientLayer
.
The demo features Spots for rendering the list view and Fakery for generating random content strings.
Extract from the demo:
Installation
Hue is available through CocoaPods. To install
it, simply add the following line to your Podfile:
Hue is also available through Carthage.
To install just write into your Cartfile: