I've made a tool, Palettegen, for creating and manipulating palettes and lightmaps, as well as possible features in the future.
As of now, it's capable of loading an image as a palette, saving programatically generated palettes, and generating lightmap data from a palette.
Using Palettegen, it can generate a colormap/lightmap from the given palette: