 		previewView.layer.borderWidth = 1.0
 	}
 	
-    // MARK: - UIControl methods
+    // MARK: - UIControl overrides
     public override func beginTrackingWithTouch(touch: UITouch, withEvent event: UIEvent?) -> Bool {
         super.beginTrackingWithTouch(touch, withEvent: event)
-        
-        updateForTouch(touch, modifyHue: true)
+		
+		// Reset saturation and brightness
+		saturation = 1.0
+		brightness = 1.0
+		
+        updateForTouch(touch, touchInside: true)
+		
         showPreview(touch)
         
         sendActionsForControlEvents(.TouchDown)

import Foundation
import CoreGraphics

public enum ColorSliderOrientation {
    case Vertical
    case Horizontal
}

@IBDesignable public class ColorSlider: UIControl {
    public var color: UIColor {
        return UIColor(h: hue, s: 1, l: lightness, alpha: 1)
    }
	
	public var orientation: ColorSliderOrientation = .Vertical {
		didSet {
			switch orientation {
			case .Vertical:
				drawLayer.startPoint = CGPointMake(0.5, 1)
				drawLayer.endPoint = CGPointMake(0.5, 0)
			case .Horizontal:
				drawLayer.startPoint = CGPointMake(0, 0.5)
				drawLayer.endPoint = CGPointMake(1, 0.5)
			}
		}
	}
	
    // MARK: Appearance
    public var edgeInsets: UIEdgeInsets = UIEdgeInsetsMake(0, 20, 0, 20) {
        didSet { setNeedsDisplay() }
    }
    @IBInspectable public var cornerRadius: CGFloat = -1.0 {
        didSet {
            drawLayer.cornerRadius = cornerRadius
            drawLayer.masksToBounds = true
        }
    }
    @IBInspectable public var borderWidth: CGFloat = 1.0 {
        didSet { drawLayer.borderWidth = borderWidth }
    }
    @IBInspectable public var borderColor: UIColor = UIColor.blackColor() {
        didSet { drawLayer.borderColor = borderColor.CGColor }
    }
	
    // MARK: Internal properties
    private var drawLayer: CAGradientLayer = CAGradientLayer()
    private var hue: CGFloat = 0.0
    private var lightness: CGFloat = 0.5
	
	// MARK: Preview view
	@IBInspectable public var previewEnabled: Bool = false
	private var previewView: UIView = UIView()
	private let previewDimension: CGFloat = 30
	private let previewOffset: CGFloat = 44
	private let previewAnimationDuration: NSTimeInterval = 0.10
	
    // MARK: - Initializers
	init() {
		super.init(frame: CGRectZero)
		commonInit()
    }

			self.previewView.transform = CGAffineTransformIdentity
		})
    }
    
    private func minimizedTransformForRect(rect: CGRect) -> CGAffineTransform {
        let minimizedDimension: CGFloat = 5.0
		
		let scale = minimizedDimension / previewDimension
