 	override func layoutSubviews() {
 		super.layoutSubviews()
 		
-		let image = getImageWithColor(UIColor.yellowColor(), size: self.frame.size)
+		hueImage = getImageWithColor(UIColor.yellowColor(), size: self.frame.size)
 	}
 	
 	func getImageWithColor(color: UIColor, size: CGSize) -> UIImage {
 		var rect = CGRectMake(0, 0, size.width, size.height)
 		UIGraphicsBeginImageContextWithOptions(size, false, 0)
+		
+		UIBezierPath(roundedRect: rect, cornerRadius: 10.0).addClip()
 		
 		if direction == .Horizontal {
 			for var x: Int = 0; x < Int(self.frame.size.width); ++x {

//		var temp = (direction == .Horizontal ? CGRectMake(tempXPlace, 0, 1.0, self.frame.size.height) : CGRectMake(0, tempYPlace, self.frame.size.width, 1.0))
//		UIRectFill(temp)
		
		if direction == .Horizontal {
			for var x: Int = 0; x < Int(self.frame.size.width); ++x {
				UIColor(hue: CGFloat(CGFloat(x) / self.frame.size.width), saturation: 1.0, brightness: 1.0, alpha: 1.0).set()
				let temp = CGRectMake(CGFloat(x), 0, 1, self.frame.size.height)
				UIRectFill(temp)
			}
		}
		else {
			for var y: Int = 0; y < Int(self.frame.size.height); ++y {
				UIColor(hue: CGFloat(CGFloat(y) / self.frame.size.height), saturation: 1.0, brightness: 1.0, alpha: 1.0).set()
				let temp = CGRectMake(0, CGFloat(y), self.frame.size.width, 1)
				UIRectFill(temp)
			}
		}
		
		
		let radius = (direction == .Horizontal ? self.frame.size.height : self.frame.size.width)
		let circleRect = (direction == .Horizontal ? CGRectMake(currentSelectionX - radius * 0.5, 0, radius, radius) : CGRectMake(0, currentSelectionY - radius * 0.5, radius, radius))

				UIRectFill(temp)
			}
		}
		
//		[UIBezierPath bezierPathWithRoundedRect:imageView.bounds
//			cornerRadius:10.0] addClip];
		
		
		
		var image: UIImage = UIGraphicsGetImageFromCurrentImageContext()
		UIGraphicsEndImageContext()
