For indexed images, allow gradient fills to interpolate along the range between two palette values, rather than between the foreground and background colors.
For example, if your palette is:
[ red, orange, yellow, green, cyan, blue, various ugly purples ]
Trying to create a gradient between red and blue at present will interpolate in RGB space, picking colors from the palette which best fit this need, using the ugly purples.
The proposed alternative mode would interpolate the palette indexes, giving you a red-to-blue hue spectrum, via the yellows and greens.
(This would also be useful for carefully curated ordered palettes where you really want a gradient to use e.g. blues from a certain block, not some other blues it finds that are closer in RGB space.)