BCColor is an open source Swift based helper library from Boyce Chang providing an assortment of color helpers with a clean syntax.
BCColor includes helpers for:
- Getting colors from an image
- Setting colors to monchrome
- Getting lighter/darker colors
- Creating gradients
- Colors from hex values
This snippet from the readme shows the basic usage of BCColor:
let colors = image?.bc_getColors()
// Generate Momochrome Image
let monochromeImage = image?.bc_monochrome()
// Hex Color
UIColor.bc_colorWithHex("#5d13e2", alpha: 1)
// Gradient Color
UIColor.bc_gradientColor(CGPointMake(0.0, 0.0), endPoint: CGPointMake(1.0, 1.0), frame:frame, colors: [UIColor.redColor(), UIColor.blueColor()])
UIColor.bc_radialGradientColor(frame, colors: [UIColor.blueColor(), UIColor.greenColor()])
You can find BCColor on Github here.
A nice Swift based color helper library.
Original article: BCColor – Swift Based Color Helper Library For Gradients, Getting Image Colors And Image And More
©2016 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.
