-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Typst uses DeviceN color spaces for HSV, HSL, Oklab, and Oklch. The PDF/A-2 spec requires the following:
For any spot colour used in a DeviceN or NChannel colour space, an entry in the Colorants dictionary shall be present. Any Separation colour space which appears in a Colorant dictionary shall obey the same restrictions as any other Separation colour space.
To express a colorant as a separation dictionary, it must act as either an subtractive or additive colorant. None of the components in the spaces we use DeviceN for behave this way. To drive this point home:
The Separation arrays in the Colorants dictionary of DeviceN and NChannel colour spaces should be consistent with the tintTransform and alternateSpace of the DeviceN or NChannel colour space itself.
Quick fix:
Fail PDF/A export if one of these color spaces is used.
Principled solution:
Convert these color values into a calibrated RGB space. The reason we do not do this at the moment is that we don't is to allow smooth interpolation by the reader in gradients. These have to be implemented as sampled functions or PostScript functions that yield RGB instead.
Note that Oklab is not expressible in ICC profile form: mm2/Little-CMS#380