How can I change the 3D View's background color to something different for each mode? I am wondering if there is a way that I can change the background color and possibly the color of other elements slightly, for each mode (Object, Edit, Sculpt, Vertex, Weight, Texture) so that it is easier to tell visually which mode I am in aside from the mode selector as an indicator.

Could it be done with some python scripting? Is there an add-on out there that would do it?

Example: Object Mode = slight blue background, Edit Mode = slight green background, etc.
Set World Background on and run this script via Blender text editor.



import bpy

Modes = {'OBJECT':(1, 0, 0),
        'EDIT':(0, 1, 0),
        'SCULPT':(0, 0, 1),
        'VERTEX_PAINT':(1, 1, 0),
        'WEIGHT_PAINT':(1, 0, 1),
        'TEXTURE_PAINT':(0, 1, 1)}

def my_handler(scene):
    mode = bpy.context.object.mode
    scene.world.horizon_color = Modes[mode]

def register():
    bpy.app.handlers.scene_update_post.append(my_handler)

def unregister():
    bpy.app.handlers.scene_update_post.remove(my_handler)

if __name__ == "__main__":
    register()