 	hex6: /^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
 	}
 
+isNumeric = (value) ->
+	return !isNaN(value) && isFinite(value)
+
 stringToObject = (color) ->
 	trimLeft = /^[\s,#]+/
 	trimRight = /\s+$/

		if @_a < 1 then return false
		return cssNames[rgbToHex(@_r, @_g, @_b, @)] or false

	setAlpha: (value) ->
		@_a = boundAlpha(value)
		@_roundA = Math.round(100*@_a) / 100
		return @

	lighten: (amount) ->
		hsl = @toHsl()
		print hsl
		hsl.l += amount / 100
		hsl.l = Math.min(1, Math.max(0, hsl.l))
		return new Color(hsl).toRgbString()

	brighten: (amount) ->
		rgb = @toRgb()
		rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))))
		rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))))
		rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))))
		return new Color(rgb).toRgbString()

	darken: (amount) ->
		hsl = @toHsl()
		hsl.l -= amount / 100
		hsl.l = Math.min(1, Math.max(0, hsl.l))
		return new Color(hsl).toRgbString()

	desaturate: (amount) ->
		hsl = @toHsl()
		hsl.s -= amount / 100
		hsl.s = Math.min(1, Math.max(0, hsl.s))
		new Color(hsl).toRgbString()

	saturate: (amount) ->
		hsl = @toHsl()
		hsl.s += amount / 100
		hsl.s = Math.min(1, Math.max(0, hsl.s))
		return new Color(hsl).toRgbString()

	greyscale: ->
		return new Color(hsl).desaturate(100).toRgbString()

	toString: ->
		return @toRgbString()

# Conversion Functions
# RGB to RGB
rgbToRgb = (r, g, b) ->
	r: if isNumeric(r) then bound01(r, 255) * 255 else 0
	g: if isNumeric(g) then bound01(g, 255) * 255 else 0
	b: if isNumeric(b) then bound01(b, 255) * 255 else 0

# RGB to HEX
rgbToHex = (r, g, b, allow3Char) ->
