 	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()

		result = null

		if fromColor not instanceof Color and toColor instanceof Color
			fromColor = toColor.copy()
			fromColor.a = 0
		else if fromColor instanceof Color and fromColor._a == 0 and toColor instanceof Color and toColor._a != 0
			fromColor = toColor.copy()
			fromColor.a = 0
		else if toColor not instanceof Color and fromColor instanceof Color
			toColor = fromColor.copy()
			toColor.a = 0
		else if toColor instanceof Color and toColor._a == 0 and fromColor instanceof Color and fromColor._a != 0
			toColor = fromColor.copy()
			toColor.a = 0

		if toColor instanceof Color

