     return color
 }
 
-private func twoColors(from color: UIColor) -> GradientColors {
-    let topColor = correct(color: color, with: kGradientTopOffset)
-    let bottomColor = correct(color: color, with: kGradientBotomOffset)
+private func topAndBottomColors(for color: UIColor, withTopHSVOffset topHSVOffset: HSVOffset = kGradientTopOffset, withBottomHSVOffset bottomHSVOffset: HSVOffset = kGradientBotomOffset) -> GradientColors {
+    let topColor = correctColorComponents(of: color, withHSVOffset: topHSVOffset)
+    let bottomColor = correctColorComponents(of: color, withHSVOffset: bottomHSVOffset)
     return (top: topColor, bottom: bottomColor)
 }

    return min(max(value, 0), 1)
}

private func correct(color: UIColor, with offset: GradientOffset) -> UIColor {
    
    var hue = CGFloat(0)
    var saturation = CGFloat(0)


public typealias GradientColors = (top: UIColor, bottom: UIColor)

typealias HSVOffset = (hue: CGFloat, saturation: CGFloat, brightness: CGFloat, alpha: CGFloat)
let kGradientTopOffset: HSVOffset = (hue: -0.025, saturation: 0.05, brightness: 0, alpha: 0)
let kGradientBotomOffset: HSVOffset = (hue: 0.025, saturation: -0.05, brightness: 0, alpha: 0)

extension UIImageView {
    
