 (->
   rgbParser = /^rgba?\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),?\s*(\d?\.?\d*)?\)$/
+  hslParser = /^hsla?\((\d{1,3}),\s*(\d?\.?\d*),\s*(\d?\.?\d*),?\s*(\d?\.?\d*)?\)$/
 
   parseHex = (hexString) ->
     hexString = hexString.replace(/#/, '')

          if hexString.substr(6, 2).length then parseInt(hexString.substr(6, 2), 16) / 255.0 else 1.0
        ]
      else
        undefined

  parseRGB = (colorString) ->
    return undefined unless bits = rgbParser.exec(colorString)

          other.b() == self.b() &&
          other.a() == self.a()

      lighten: (amount) ->
        hsl = self.toHsl()
        hsl[0] = hsl[0].round()
        hsl[2] = hsl[2] + amount

        return Color(hslToRgb(hsl))

      darken: (amount) ->
        hsl = self.toHsl()
        hsl[0] = hsl[0].round()
        hsl[2] = hsl[2] - amount

        return Color(hslToRgb(hsl))

      rgba: -> "rgba(#{self.r()}, #{self.g()}, #{self.b()}, #{self.a()})"

