Gradient Part 2a - Fix sharp gradients in SVG#2307
Merged
laurmaedje merged 2 commits intotypst:mainfrom Oct 4, 2023
Merged
Conversation
Contributor
Author
|
@laurmaedje as @reknih and I discussed hue interpolation this morning on Discord, you can merge this as long as it passes your code review. |
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tracking issue: #2282
This fixes sharp gradients in SVG export as well as adding a test for the
smoothnessargument ongradient.sharp.I have also noticed the following on which I would like your opinion: hue gradients (so gradients that involve hue rotations) can be... tricky, in some cases such as:
Will render as:

This is because it sees the part 0 -> 359 degrees as being a change of color, but the 359 -> 0 degrees as also being an increase, but so small that the color difference is literally zero. I was wondering whether I should annotate the doc to say that hsv and hsl gradients should use increase hue, or whether we could try and support this better? There is already a lot of code specifically for hsv and hsl gradients and I don't want to add potentially a lot, does anybody know how (others?) to handle that nicely?
Edit
As discussed on Discord, we will implement the ability to choose how to do hue interpolation, but that will be in part 6 as per #2282