Convert your table of colors into a 1D image and use -
clut to apply that to your image.
see
http://www.imagemagick.org/Usage/color_mods/#color_lut
You can either append 256 1pixel images together to create the 1D image or use NetPBM format to convert text color values to an image.
convert xc:"rgb(0,0,0)" xc:"rgb(...)" ... +append 1Dlut.png
see
http://www.imagemagick.org/Usage/formats/#netpbm
You would skip the -scale and would create 3 lists of 256 grayvalues, one for each of the r,g,b channels then combine them together and apply to the image.
also
http://netpbm.sourceforge.net/doc/pgm.html will explain the format.
Make 3 lists (or arrays): redlist, greenlist, bluelist
echo "P2 256 1 255 $redlist" | convert - redlut.png
echo "P2 256 1 255 $greenlist" | convert - greenlut.png
echo "P2 256 1 255 $bluelist" | convert - bluelut.png
convert redlut.png greenlut.png bluelut.png -combine -colorspace sRGB colorlut.png
convert image colorlut.png -
clut resultimage
P.S. What version of IM are you using and on what platform? Syntax may differ!