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(adjustHue): account for potential negative hue value #438

Merged
merged 4 commits into from May 18, 2019

Commits on May 12, 2019

  1. fix(hslToRgb): correct % for potential negative hue

    Due to the Javascript modulo bug
    (https://stackoverflow.com/questions/4467539/javascript-modulo-gives-a-negative-result-for-negative-numbers),
    any negative value for hue results in a bug where the resulting color will be black. Negative hues
    should cycle through to 359, so that functions like `adjustHue()` can provide consistent behavior
    for all colors.
    
    fix styled-components#437
    davidde committed May 12, 2019
    Configuration menu
    Copy the full SHA
    0ff9177 View commit details
    Browse the repository at this point in the history
  2. refactor(adjustHue): remove redundant %

    Since the % operation is already performed inside `hslToRgb()` in `src/internalHelpers/_hslToRgb.js`
    (which `adjustHue()` eventually calls through `toColorString()`), this % is completely redundant.
    
    refactor styled-components#437
    davidde committed May 12, 2019
    Configuration menu
    Copy the full SHA
    1662a30 View commit details
    Browse the repository at this point in the history

Commits on May 18, 2019

  1. Configuration menu
    Copy the full SHA
    9b4f594 View commit details
    Browse the repository at this point in the history
  2. test(hslToRgb): negative hue test

    Test hslToRgb's ability to handle negative hues passed in through adjustHue.
    
    tests styled-components#437
    davidde committed May 18, 2019
    Configuration menu
    Copy the full SHA
    4852d6f View commit details
    Browse the repository at this point in the history