         completionHandler()
     }
     
-    func findColors() -> (colors: [CACountedRGBColor], edgeColors: [CACountedRGBColor])? {
+    func findEdgeColors() -> [CACountedRGBColor]? {
         let width = image.width
         let height = image.height
         

                let color = CARGBColor(r: CGFloat(data[index]) / 255,
                                       g: CGFloat(data[index+1]) / 255,
                                       b: CGFloat(data[index+2]) / 255)
                colorSet.add(color)
                if row==0 || row==height-1 || col==0 || col==width-1 {
                    edgeColorSet.add(color)
                }
            }
        }
        
        let colors = colorSet.objectEnumerator().allObjects.flatMap() { color -> CACountedRGBColor? in
            guard let rgbColor = color as? CARGBColor else {
                return nil
            }
            let count = colorSet.count(for: rgbColor)
            if count > 2 {
                return CACountedRGBColor(color: rgbColor, count: count)
            } else {
                return nil
            }
        }
        
        let edgeColors = edgeColorSet.objectEnumerator().allObjects.flatMap() { color -> CACountedRGBColor? in
            guard let rgbColor = color as? CARGBColor else {
                return nil
            }
            let count = edgeColorSet.count(for: rgbColor)
            if count > 2 {
                return CACountedRGBColor(color: rgbColor, count: count)
            } else {
                return nil
            }
        }
        
        return (colors, edgeColors)
    }
    
    func findEdgeColor(in edgeColors: [CACountedRGBColor]) -> CARGBColor? {

    }
    
    public func analyze() {
        guard let edgeColors = findEdgeColors(),
            let background = findEdgeColor(in: edgeColors) else {
            return
        }
        
        let colors = findColors(isDarkBackground: background.isDark)
        let textColors = colors.flatMap() { findTextColor(in: $0, background: background) }
        
        let fallback:CGColor
        if background.isDark {
