I need to do some colorspace transformation for a new feature I’m working on, but color theory is not really my thing, and I want to make sure I’m doing it right.
What I need to do is to transform from/to the colorspace a given module is working on.
Right now darktable have:
raw until demosaic
rgb until colorin
lab until colorout
I’m using dt_sRGB_to_XYZ() / dt_XYZ_to_Lab <-> dt_Lab_to_XYZ() / dt_XYZ_to_sRGB() 
but as the code says, linear sRGB -> gamma corrected sRGB, probably this is not the right way to do it.
Any help on this will be appreciated.