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


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

  saveShape: (shape) ->
    @execute(new actions.AddShapeAction(this, shape))
    @trigger('shapeSave', {shape: shape})
    @trigger('drawingChange')

  pan: (x, y) ->
    # Subtract because we are moving the viewport
