 
 	return { r:r*255, g:g*255, b:b*255 }
 
-# RGB to HSV
-rgbToHsv = (r, g, b) ->
-	r = bound01(r, 255);
-	g = bound01(g, 255);
-	b = bound01(b, 255);
-
-	max = mathMax(r, g, b)
-	min = mathMin(r, g, b)
-	h
-	v = max
-
-	d = max - min
-	s = if max is 0 then 0 else d / max
-
-	if(max == min)
-		h = 0  # achromatic
-	else
-		h = switch(max)
-			when r then (g - b) / d + (g < b ? 6 : 0)
-			when g then (b - r) / d + 2
-			when b then (r - g) / d + 4
-		h /= 6;
-
-	h: h, s: s, v: v
-
 # HSV to RGB
 hsvToRgb = (h, s, v) ->
 


			if color.hasOwnProperty("a")
				a = color.a
			else if color.hasOwnProperty("alpha")
				a = color.alpha

	a = correctAlpha(a)


	return { r: r * 255, g: g * 255, b: b * 255 }

# Utility Functions

convertToPercentage = (n) ->
	if n <= 1 then n = n * 100 + "%"
