         @minDim = Math.min dim.x, dim.y, dim.z
 
         @center = @rescale @boundingBox.geometry.boundingBox.center()
+
+    setColor: ->
+        # setup color stuff
+        @background = new THREE.Color @opts.background...
+        @element.style.background = @background.getStyle()
+        if @frameOpts.color?
+            @frameColor = new THREE.Color @frameOpts.color...
+        else
+            @frameColor = new THREE.Color(
+                1-@background.r, 1-@background.g, 1-@background.b)
 
     # always call this after adding things to the scene to make sure track
     # controls are sorted out, etc. The client should never have to worry


        @setOnMouseOver()

        # possibly show the canvas warning.
        if @opts.renderer is 'canvas'
            @element.title = 'WARNING: using slow non-WebGL canvas renderer'

    attachToDom: (parentElement) ->
        if @element?
            removeElement @element
        else
            @element = document.createElement 'span'
            @element.className = 'math-3d-viewer'
            @element.style.display = 'inline-block'

        parentElement.appendChild @element

    setDynamicRenderer: ->
        if @rendererType is 'dynamic'

            @opts.width ?= document.documentElement.clientWidth/2
            @opts.height ?= @opts.width*2/3

            # setup aspect ratio stuff
            aspectRatio = @aspectRatio = new THREE.Vector3 @opts.aspect_ratio...
            @scaleSize = @aspectRatio.length()
