Reputation: 1863
I am using a lot of different background images in my project and I wanted to know how can I adjust the UITextLabel colour according to the Background Image View on my View Controller? i.e. if the background is dark the text will become .white whereas if the background is light the text will become .black. Any help will be highly appreciated:)
Upvotes: 0
Views: 844
Reputation: 290
If you are okay with using third-party libraries, what I would suggest is to use https://cocoapods.org/pods/ChameleonFramework to get access to its function
ContrastColorOf(backgroundColor: UIColor, returnFlat: Bool)
Upvotes: 0