C-DEX is an effect that allows for gradient mapping. An offset parameter enables palette animation as well, which is the highlight of the effect. It is designed to be as easy to use as possible.
Here is a demo in executable form:
Use it to play around with the parameters and to see what it does. Just click on any of the options in the menu, then use the mouse wheel to change that parameter. In the lower part of the window you will find two buttons allowing you to load your own color palettes/gradients and background images. The latter should be in some power-of-two format (16x256, 32x32, 128x8, etc.) to be able to animate the background. The gradients can be in any format or size, just load any texture you get your hands on. Download link: C-DEX Demo A.rar
EDIT: And here some explanations for usage. The effect recolors everything underneath the object it is applied to, using the first pixel line of the texture of that object from left to right. "offset" shifts the start value for mapping to the right and is used as a value from 0.0 (=left) to 1.0 (=right). You can enter a value higher than 1.0, it will then calculate the correct position (2.2 = 0.2, 3.0 = 0, 4.7 = 0.7, etc.) If you enter a negative number, then the range of colors to map to is reduced until you reach -1.0, at which point only the leftmost color remains. Could serve for a nice color fade in effect, or something)
If you want to use it as a layer effect, the gradient should be on the top of that layer, and again the full length is sampled. (You could just place the gradient object on that layer, as an example). Everything underneath that layer is then recolored.
Note: Due to the nature of the effect and the limitations of the hlsl-implemetation, rotation of the object is not possible (the colors are still sampled from the first pixel line of the bounding box)