                     var white: CGFloat = 0.0
                     var alpha: CGFloat = 0.0
                     backgroundColor.getWhite(&white, alpha: &alpha)
-                    if alpha > 0.5 {
+                    if alpha > Threshold.alpha {
                         color = backgroundColor
                         break
                     }

        var alpha: CGFloat = 0.0
        if let visibleBackgroundColor = visibleBackgroundColor {
            visibleBackgroundColor.getWhite(&white, alpha: &alpha)
            isBackgroundLight = white > 0.5
        }
        return isBackgroundLight
    }


extension UIView {
    
    struct Threshold {
        static let alpha: CGFloat = 0.5
        static let white: CGFloat = 0.8
        static let black: CGFloat = 0.2
    }
    
    /// Color that shows through background of the view. Recursively checks superview if view background is clear.
    var visibleBackgroundColor: UIColor? {
        get {
