Skip to content

Conversation

@erxclau
Copy link
Contributor

@erxclau erxclau commented Dec 3, 2024

The current float to integer cast truncates the hues when converting from HSL to RGB. This PR rounds to the nearest integer before the cast.

See linebender/resvg#786 for discussion.

Modifies tests with hsl(120, 100%, 75%, 0.5) to match with rgb(128, 255, 128) and adds one new test case.

Chrome developer tools:
Screenshot 2024-12-02 at 11 00 54 PM

Safari developer tools:
Screenshot 2024-12-02 at 11 06 15 PM

@erxclau erxclau marked this pull request as ready for review December 3, 2024 04:07
@waywardmonkeys
Copy link
Collaborator

I think this looks good to me on a first glance, but could you rebase it and your other PR forward so that they are using the updated CI checks that we just landed today?

Also, it might be good to talk with you about some of what we're doing in the Linebender organization with color (and our color crate). Are you on our Zulip?

@DJMcNab DJMcNab added this pull request to the merge queue Dec 3, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 3, 2024
@erxclau
Copy link
Contributor Author

erxclau commented Dec 3, 2024

Rebased this to fix a test case from #31 to expect new rounding behavior.

@DJMcNab DJMcNab added this pull request to the merge queue Dec 3, 2024
Merged via the queue into linebender:main with commit b1cd401 Dec 3, 2024
15 checks passed
@waywardmonkeys waywardmonkeys added this to the 0.15.3 milestone Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants