How to implement a realtime 2D light renderer with fog/colored light on the GPU?
If your wall geometry is vector graphics you can simply extrude the segment away from the light position. This means 2 triangles per draw call, all the extrusion offsets can  can be handled in the vertex shader.



Image 1: For each wall generate a shadow volume extrusion.

Quick and extremely dirty sample implementation of shadow volumes here:


http://webglplayground.net/saved/AeN6yoNGih (please do not save your own version, fork instead)


Now since your shader can color the triangles as they see fit you can apply a shader on the triangles that is colored. Just like you would render transparent surfaces. To do this proper you may need a offscreen buffer for getting a proper color accumulation mode.



Image 2: Coloring the volumes based on distance to light.

Certainly the coloring algorithm may be whatever you like. for example the color could become darker the nearer you are to the extrude edge etc. 

And here is very quickly done extremely dirty live example of colored shadow volumes:


http://webglplayground.net/saved/9xgxDbtY7f (please do not save your own version, fork instead), very bad code style done on the run (and on my phone).


This is just one way hopefully others will elborate. You can also use the exact same methods as you would in 3d. As for nonuniform fog, you could just use a raymarcher.