Skip to content

gradient.linear with sharp will alias depending on space used #6326

@djacu

Description

@djacu

Description

When viewing a linear gradient inside a rectangle and using the sharp function, aliasing between the colors can show up if the space argument is used.

Version

$ typst --version
typst 0.13.1 (unknown hash)

Code

#rect(width: 100%, height: 5em, fill: gradient.linear(
  (oklch(51%, 0.208963, 29.2339deg)),
  (oklch(70%, 0.204259, 43.4910deg)),
  (oklch(81%, 0.168100, 76.7800deg)),
  (oklch(60%, 0.175100, 147.560deg)),
  (oklch(60%, 0.141400, 241.380deg)),
  (oklch(46%, 0.194300, 288.710deg)),
).sharp(6))

#rect(width: 100%, height: 5em, fill: gradient.linear(
  space: color.oklch,
  (oklch(51%, 0.208963, 29.2339deg)),
  (oklch(70%, 0.204259, 43.4910deg)),
  (oklch(81%, 0.168100, 76.7800deg)),
  (oklch(60%, 0.175100, 147.560deg)),
  (oklch(60%, 0.141400, 241.380deg)),
  (oklch(46%, 0.194300, 288.710deg)),
).sharp(6))

Screenshot from Zathura PDF viewer

Image

Screenshot from Okular PDF viewer

Image

For some reason this phenomena does not show up in typst.app.

Reproduction URL

https://typst.app/project/rnzQ5cDvguAygjlMJI6Ti9

Operating system

Linux

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