Skip to content
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

Fix conversion issues with HWB and HSL #79

Merged
merged 1 commit into from
Mar 22, 2021

Conversation

facelessuser
Copy link
Collaborator

@facelessuser facelessuser commented Mar 22, 2021

  1. HSL: Avoid divide by zero cases
  2. HSL: values are in range [0, 1] and scale to 100% at end
  3. HWB: Avoid divide by zero cases in HWB
  4. HWB: values are in range [0, 1] and scale to 100% at end
  5. HWB: Fix case where achromatic HWB colors were not scaled correctly
    when returned as HSV.

Fixes #74

1. HSL: Avoid divide by zero cases
2. HSL: values are in range [0, 1] and scale to 100% at end
3. HWB: Avoid divide by zero cases in HWB
4. HWB: values are in range [0, 1] and scale to 100% at end
5. HWB: Fix case where achromatic HWB colors were not scaled correctly
   when returned as HSV.
Copy link
Member

@svgeesus svgeesus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this looks great, thanks!

src/spaces/hwb.js Show resolved Hide resolved
@svgeesus svgeesus merged commit e09506a into color-js:master Mar 22, 2021
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.

HSL algorithm can divide by zero
2 participants