Space invasion: GIMP color palettes produce wrong colors when changing RGB working spaces
In GIMP-2.99 (and GIMP-2.10), an RGB color palette (for painting, not talking about Indexed image colormap palettes) only produces the intended colors for images in the RGB color space in which the RGB color palette was produced. So for example, a palette of colors made for an sRGB image produces wrong colors for ClayRGB images, Rec.2020 images, and so on, and vice versa.
The space invasion won't be complete until an artist or photographer (photographers do use color palettes, for example when recoloring a black and white image) can set up and use a palette of colors without having to redo the palette for every RGB working space they might want to use.
Using LCh or (XYZ/Lab/xyY/etc) as the color space for holding color palette colors would help with this problem of how to have "AnyRGB" color palettes. I took my code for high bit depth color palettes from ##1328 and modified it further to allow loading and saving LCh color palettes in my "CCE" version of GIMP-2.10.
There is still the problem that my current code converts between LCh and RGB when loading, importing, and saving a palette, so the palette only works for the RGB color space that was active when the image was opened, or in sRGB if no image was opened when the palette was loaded.
My current workaround is to put my LCh palettes in a folder outside of where GIMP looks for palettes (in my case in the prefix in a folder called "config" in a subfolder called "palette"), open an image, and then import the desired palette(s), so the palette is created in the RGB working space of the image. This of course requires only working in one RGB working space for any given editing session, and deleting anything in the "palette" folder upon restarting GIMP.
If anyone expresses an actual interest with intent to look at my high bit depth LCh color palette code, put a note here and I'll port the code to GIMP-2.99. But please don't ask if you actually aren't really interested :) .
I think it would be relatively easy to put a line in the palette load/save code to indicate what color space/model to use when loading/saving any given high bit depth color palette. I haven't actually written any code to do this as personally LCh is the only color space that I use for palettes. But surely a single line in the palette with appropriate babl fishes defined for the conversion to RGB would do the trick.
One way to "Change the palette RGB values when changing the image RGB working space" might be to reload the palette when the working space changes. I haven't figured out where such code might go.