   l: l
 
 parseCssRgb = (rgb_str) ->
-  rgb = /^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(1|0\.\d+))?\)$/.exec(rgb_str)
+  rgb = /^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(1|0(\.\d+)?))?\)$/.exec(rgb_str)
+
   r: rgb[1]
   g: rgb[2]
   b: rgb[3]
-  a: if rgb.length > 4 then rgb[4] else 1
+  a: if rgb.length > 4 && rgb[4]? then rgb[4] else 1
 
 
 window.isLightBackground = (el, callback) -> 


    # Skip this element if it doesn't contribute to background color
    # or if it is a decendent of behind_el
    skip_element = (behind_el && $(behind_el).has($(el)).length > 0) ||
                    (!is_image && $(el).css('background-color') == 'rgba(0, 0, 0, 0)')

    if skip_element
      hidden_els.push [el, el.style.visibility]

      el = document.elementFromPoint(x,y)

    else if !is_image
      rgb = parseCssRgb bg_color
      hsl = rgb_to_hsl rgb
      color = {rgb, hsl} 
      callback color if callback
