             } else {
                 return nil
             }
-        } as [CACountedRGBColor]//.sorted() { $0.count > $1.count }
+        } as [CACountedRGBColor]
         
         return (colors, edgeColors)
     }

    public var secondaryColor: CGColor?
    public var detailColor: CGColor?
    
    public init(image: CGImage) {
        self.image = image
    }
    
    public func analyze() {

    
}

extension CGImage {
    
    func scaling(to size: CGSize) -> CGImage? {
        guard let colorSpace = self.colorSpace else {
            return nil
        }
        
        let context = CGContext(data: nil,
                                width: Int(size.width),
                                height: Int(size.height),
                                bitsPerComponent: bitsPerComponent,
                                bytesPerRow: bytesPerRow,
                                space: colorSpace,
                                bitmapInfo: bitmapInfo.rawValue)
        context?.draw(self, in: CGRect(origin: .zero, size: size))
        
        return context?.makeImage()
    }
    
}

