Is there a filter to map the lightness of source pixels to the hue value of a pixel?
I'm looking for some sort of effect similar to the "Colorama effect" in After Effects?
Inkscape has some color modifying filters and extensions but I guess nothing creates what you want. There's simply no way to control all items in a complex vector drawing simultaneously to search a good total effect.
The idea fits much better to bitmap images. In Photoshop, GIMP and many other bitmap image editors you can twist color curves and apply gradient maps. You can also extract HSL values of a layer to RGB numbers of another layer and generate for ex. from L-numbers your new H-numbers.
I guess the gradient map is the easiest way to get started with good control over the result. Use blending mode "Hue" to transfer the new hue to your image if you want to keep the lightness and the saturation. Here's an example in Photoshop:
The used gradient maps black to blue and white makes green. The gradient can be built and edited freely or a preset can be selected. This gradient happened to look colorful and it was readily available.
If one wants to use original luminosities he can place a copy of the original image on the top and let it have blending mode Luminosity:
RGB color system has a limitation (due the screen technology). All color is lost near max and min luminosities. That can be reduced by decreasing the contrast. Just in this case it can be done by reducing the opacity of the top layer :