   removeEventListener: (name, wrapper) ->
     @canvas.removeEventListener(name, wrapper)
 
+  # actual ratio of drawing-space pixels to perceived pixels, accounting for
+  # both zoom and displayPixelWidth. use this when converting between
+  # drawing-space and screen-space.
   getRenderScale: -> @scale * @backingScale
 
   clientCoordsToDrawingCoords: (x, y) ->


  setColor: (name, color) ->
    @colors[name] = color
    @trigger "#{name}ColorChange", @colors[name]
    switch name
      when 'background'
        @containerEl.style.backgroundColor = @colors.background

        @repaintLayer('main')
      when 'secondary'
        @repaintLayer('main')
    @trigger "#{name}ColorChange", @colors[name]
    @trigger "drawingChange" if name == 'background'

  getColor: (name) -> @colors[name]
