Is there any way to make QR code cmyk(0%, 0%, 0%, 100%)?
I tried packages rustycure, cades, tiaoma, and told them to make with dark-color/ color/ fg-color: cmyk(0%,0%,0%,100%), but in final PDF I get composite color cmyk(71%, 68%, 64%, 73%).
I cannot give this file to press: small shifts of colors will make QR unreadable.
I do not understand how it can help.
When I use #text(fill: cmyk(0%,0%,0%,100%)), I get the result I need in PDF.
But this does not happen with QR code.
I have an explanation for tiaoma, cades, and rustycure. All these packages use some libraries to generate SVG images, but the SVG standard only supports RGB colors.
For example, tiaoma uses zint to generate an SVG, If you click into tiaoma/0.3.0/lib.typ, you’ll find the following code.
if type(c) == color {
return c.to-hex().slice(1)
}
#cmyk(0%, 0%, 0%, 100%).to-hex() is #221f2, and it becomes cmyk(71%, 68%, 64%, 73%) at last.
There are some issues with CMYK that Typst outputs, so it’s not possible to do this right now, IIUC. Based on QR in real CMYK / grayscale - #4 by Y.D.X, the situation is even worse.
I doubt… It looks like that the conversion between color spaces is lossy. Say, cmyk(0%, 0%, 0%, 100%).rgb().cmyk() is not K, and black.cmyk().rgb() does not equal #black.rgb() either.
Some libraries are capable of drawing QR codes with Unicode characters (like ▀█ ▀▀▀▀▀██▀▀▄). This might be a feasible workaround at present.
Solution is cmyk(50%, 50%, 50%, 100%) which turns into #000001. You can’t get printers to print #000000 because that requires you to spray carbon nanotubes onto the printing surface
Tested cmyk(50%, 50%, 50%, 100%) though and it works as expected. Using pure K color will vary depending on viewer, but it’s incorrect to show it as rich black anyway - so if they do so, they’re lacking.