-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
bugSomething isn't workingSomething isn't workinggood contributionSuitable for contribution, but unlike "good first issue", it may need prior experienceSuitable for contribution, but unlike "good first issue", it may need prior experiencehelp wantedExtra attention is neededExtra attention is neededpdfRelated to PDF export or PDF embedding.Related to PDF export or PDF embedding.
Description
Description
When applying a gradient with alpha, the PDF export puts a white background behind the gradient.
Preview on webapp behaves as expected
PNG export behaves as expected.
PDF export does not match preview nor PNG, it places a white background behind the gradient.
// nested rectangles
#rect(fill: rgb(50%, 50%, 0%))[
#rect(fill: rgb(50%, 0%, 0%))[#h(100%)]
]
// transparent rectangles
#rect(fill: rgb(50%, 50%, 0%, 120))[
#rect(fill: rgb(50%, 0%, 0%, 120))[#h(100%)]
]
// gradient has white background in PDF export
#let transparent = rgb(255, 255, 255, 0)
#rect(fill: rgb(50%, 50%, 0%, 100))[
#rect(fill: gradient.linear(transparent, transparent, rgb(50%, 0%, 0%), transparent, transparent))[#h(100%)]
]
// for completeness, a color with a specified alpha value also fails
#rect(fill: rgb(50%, 50%, 0%, 100))[
#rect(fill: gradient.linear(transparent, transparent, rgb(50%, 0%, 0%, 120), transparent, transparent))[#h(100%)]
]I am not 100% familiar with how a PDF document works, but somewhere in the chain, I suspect that the gradient's transparency information is lost.
Reproduction URL
No response
Operating system
Web app
Typst version
- I am using the latest version of Typst
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood contributionSuitable for contribution, but unlike "good first issue", it may need prior experienceSuitable for contribution, but unlike "good first issue", it may need prior experiencehelp wantedExtra attention is neededExtra attention is neededpdfRelated to PDF export or PDF embedding.Related to PDF export or PDF embedding.