-
-
Notifications
You must be signed in to change notification settings - Fork 859
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong color encoding in PDF gradients #4422
Comments
The problem seems to be that only the first three components are stored for each color in the shading function as we assume that the last component is always the alpha value, but in CMYK it's the black value: typst/crates/typst-pdf/src/color.rs Lines 391 to 400 in a2c9807
If I manually add a fourth component in the PDF file, the gradients look more correct (and show up in edge). |
I just found out that a very similar issue also affects luma gradients. The colors are also stored with three components (where all are the same)
but the D65Gray color space seems to only expect a single component, making Edge (and I suppose Adobe Acrobat) fail to render the gradient. When removing the additional numbers from |
Description
Gradients using the CMYK color space don't produce the same results in PDF as in the webapp preview. The behaviour is also dependent on the viewer or printer.
Example Code
Reproduction URL
No response
Operating system
Web app, Windows
Typst version
The text was updated successfully, but these errors were encountered: