       @insertTextBackground()
 
       @colors.workspaceBgColor=style(@elements.editor).backgroundColor
-      @colors.treeOriginalRGB=style(@elements.treeView).backgroundColor
+      if @elements.treeView?
+        @colors.treeOriginalRGB=style(@elements.treeView).backgroundColor
       @packagesLoaded = true
 
       videoOpacity = (conf.video.opacity/100).toFixed(2)

    keys = Object.keys @elements
    loaded = (@elements[k] for k in keys when @elements[k]?)
    #console.log 'keys',keys,loaded
    if loaded.length == keys.length

      @insertMain()
      @popup = new popup()

  z-index:0;"

colorToArray = (str) ->
  if !str?
    return [0,0,0,0]
  result = str.replace(/[^\d,\.]/g,'')
  result = result.split(',')
  result
