Skip to content

Instantly share code, notes, and snippets.

@kidcodely
Created November 19, 2017 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kidcodely/6cc4db799695349cd942b9d83c595d03 to your computer and use it in GitHub Desktop.
Save kidcodely/6cc4db799695349cd942b9d83c595d03 to your computer and use it in GitHub Desktop.
Contrasting Background Example (Chameleon)
import UIKit
import ChameleonFramework
class RootViewController: UIViewController {
@IBOutlet var myTitle: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
myTitle.textColor = ContrastColorOf(backgroundColor: view.backgroundColor!, returnFlat: false)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment