If you have an ICC profile for your colorspace, then you can call one of these functions:
They all load the ICC profile from the specified source, and create the ICC based fz_colorspace.
Unfortunately, in non-ICC based workflows, ICC profiles can’t be loaded. This means that document handlers have to be prepared to ‘fall back’ to a non-ICC based approximation. This has to be done at the document handler level; for example the PDF agent calls fz_get_cmm_engine, and if it returns NULL, drops back to the alternate specified space.