Skip to content

Panic when two gradient stops have offset 0% with PNG export #6162

@MDLC01

Description

@MDLC01

Description

#rect(
  fill: gradient.linear(
    (red, 0%),
    (green, 0%),
    (blue, 100%),
  )
)

panics with

thread 'main' panicked at crates\typst-render\src\paint.rs:260:10:
components must always be in the range [0..=1]

when exporting to PNG. The panic does not occur when exporting to SVG or PDF.

Reproduction URL

No response

Operating system

No response

Typst version

  • I am using the latest version of Typst

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcrashThe Typst compiler crashes for some inputpngRelated to PNG export.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions