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
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)
iOS 9+
ColoredLabel is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'ColoredLabel'
Luccifer, gleb.karp@gmail.com
ColoredLabel is available under the MIT license. See the LICENSE file for more info.