Skip to content

PDF Export Oklab gradient is interpolated in RGB #7316

Closed

Description

@BenediktKarl

When trying to export a rect with a linear gradient that is supposed to interpolate in Oklab, it interpolates in RGB instead. Both firefox and Adobe Acrobat display a linear RGB gradient.

Steps to reproduce:

  1. Create a document with the following typst source:
#grid(
  columns: (50pt, 1fr),
  rows: (50pt, 50pt),
  [RGB],
  [
    #rect(
      width: 100%,
      fill: gradient.linear(rgb(255, 0, 0), rgb(0, 255, 0), space: rgb)
    )
  ],
  [Oklab],
  
  [
    #rect(
      width: 100%,
      fill: gradient.linear(rgb(255, 0, 0), rgb(0, 255, 0), space: oklab)
    )
  ],
)
  1. Export as PDF and open in Acrobat or Firefox
  2. Observe both gradients look identical and are interpolated in RGB

Activity

  1. LaurenzV commented on Nov 6, 2025

    @LaurenzV
    Collaborator

    As far as I can tell the issue also exists with Typst 0.13.1, so it at least doesn't seem to be a regression.

  2. Enivex commented on Nov 6, 2025

    @Enivex
    Collaborator

    @Dherse is the resident gradient expert

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions