Skip to content

Wrong colours in PDF export in some viewers #2257

@Zheoni

Description

@Zheoni

Description

The error was introduced in #2171

In PDF export, at least luma colours are off in some viewers. PNG and SVG is fine.

This example document:

#set page(height: auto, width: auto, margin: 5mm)
#rect(width: 2cm, height: 2cm, fill: luma(70%))
#rect(width: 2cm, height: 2cm, fill: rgb("#b3b3b3"))

In 0.8.0 stable displays fine in all tested viewers.
image

After #2171 in some viewers, the luma is tinted red.
image

This was tested and failed in Okular and Libre Office Draw. Many more viewers show the correct output. The two that failed share the same renderer, poppler, as pointed out by @Dherse in discord. So it's probably an issue with poppler and ICC profiles and not typst, but I thought an opening an issue was not a bad idea.

Also, the second rect, the RGB colour is a little bit off and display #b4b4b4 instead of #b3b3b3. I can't notice this, only with a colour tool, and it's maybe related to #1927 or a rounding error with ICC profiles. This is not related to this issue.

Reproduction URL

No response

Operating system

Windows

Typst version

  • I am using the latest version of Typst

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingvisualizeRelated to the visualize category, which is about drawing and illustrating

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions