Skip to content

Latest commit

 

History

History
47 lines (30 loc) · 1.56 KB

README.md

File metadata and controls

47 lines (30 loc) · 1.56 KB

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, [email protected]

License

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