Luccifer / ColoredLabel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ColoredLabel

CI Status Version License Platform

About

A simple lib that can help to add onto the ImageView a/(an?) UILabel which will change it's color state depending on the colors and dark/light summarization of image under it

GIF

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

@IBOutlet weak var coloredLabel: UILabel!
@IBOutlet weak var imageView: UIImageView!

var isForest: Bool = true

imageView.image = (self?.isForest)! ? UIImage(named: "mountains") : UIImage(named: "forest")
isForest = !isForest
coloredLabel.colorLabelIfNeededWith(image: imageView.image, colorIfImageIsLight: .black, colorIfImageIsDark: .yellow, lightThreshhold: 0.5)

Requirements

iOS 9+

Installation

ColoredLabel is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'ColoredLabel'

Author

Luccifer, gleb.karp@gmail.com

License

ColoredLabel is available under the MIT license. See the LICENSE file for more info.

About

License:MIT License


Languages

Language:Swift 80.9%Language:Ruby 19.1%