Skip to content

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

Closed

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

Activity

  1. added
    bug
    on May 23, 2025
  2. added
    visualize
    on May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugvisualize

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions