MuPDF allows for indexed colorspaces - those where a palette is used to select color values from a (normally) larger colorspace.
These are created using the fz_new_indexed_colorspace call: