     }
     
     public func scale(image: UIImage) -> UIImage? {
-        let rect = drawRect(for: image)
         var alpha: CGFloat = 0.0
         var white: CGFloat = 0.0
         backgroundColor.getWhite(&white, alpha: &alpha)

    return CGRect(origin: (size - newSize).mid, size: newSize)
}


#if os(iOS) || os(tvOS)
    

            UIRectFill(CGRect(origin: CGPoint.zero, size: size))
        }
        
        image.draw(in: drawRect(for: image))
        
        let scaledImage = UIGraphicsGetImageFromCurrentImageContext()
        UIGraphicsEndImageContext()
