Fix #3621: function-based PDF shadings keep their colours

PDF import turned every function-based shading (ShadingType 1) into a
flat mid-grey. Chromium writes a CSS repeating-linear-gradient this way,
so a red and white hatch came in as a grey bar.

A function-based shading whose colour changes along one axis of its
domain only now becomes a linear gradient across the domain: stops
sampled along that axis, each hard colour change (found by halving the
interval between two samples) two stops at one offset. One whose colour
changes in two directions comes in as its average colour, with a
warning. Either paints only over the shading's domain.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Patrick Lenzen
2026-10-24 19:27:44 +07:00
committed by bflatastic
co-authored by Claude Opus 5.5
parent 95436e7212
commit 095d2bd2fd
4 changed files with 268 additions and 25 deletions
File diff suppressed because one or more lines are too long