Skip to content

Bugfix: HSL color ordering in ManimColor #4202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 21, 2025

Conversation

thehugwizard
Copy link
Contributor

Overview: What does this pull request change?

Fixes the HSL ordering when using ManimColor.from_hsl and ManimColor.to_hsl

Motivation and Explanation: Why and how do your changes improve the library?

colorsys uses HLS (hue, luminance, saturation) ordering when converting to/from rgb. Manim says it uses HSL ordering. Fixed order of parameters in call to colorsys for ManimColor.from_hsl and ManimColor.to_hsl.

Added tests ensure correct HSL ordering.

Reviewer Checklist

  • The PR title is descriptive enough for the changelog, and the PR is labeled correctly
  • If applicable: newly added non-private functions and classes have a docstring including a short summary and a PARAMETERS section
  • If applicable: newly added functions and classes are tested

Sorry, something went wrong.

…converting to/from rgb. Manim says it uses HSL ordering. Fixed order of parameters in call to colorsys for ManimColor.from_hsl and ManimColor.to_hsl.

Added tests ensure correct HSL ordering.
pre-commit-ci bot and others added 3 commits March 23, 2025 12:14
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
@github-project-automation github-project-automation bot moved this from 🆕 New to 👍 To be merged in Dev Board Apr 21, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@JasonGrace2282 JasonGrace2282 enabled auto-merge (squash) April 21, 2025 01:35
@JasonGrace2282
Copy link
Member

Thanks!

@JasonGrace2282 JasonGrace2282 merged commit 593010b into ManimCommunity:main Apr 21, 2025
21 checks passed
@github-project-automation github-project-automation bot moved this from 👍 To be merged to ✅ Done in Dev Board Apr 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants