Skip to content

Luccifer/ColoredLabel

Repository files navigation

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

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published