       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


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



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

  l: l

parseCssRgb = (rgb_str) ->
  if rgb_str == 'transparent'
    {r: 0, g: 0, b: 0, a: 0}
  else  
    rgb = /^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(1|0(\.\d+)?))?\)$/.exec(rgb_str)

    r: parseInt rgb[1]
    g: parseInt rgb[2]
    b: parseInt rgb[3]
    a: if rgb.length > 4 && rgb[4]? then parseInt(rgb[4]) else 1


window.isLightBackground = (el, callback) -> 
