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

fixed problem in range_to when hue should've cycled. #48

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

alexhagen
Copy link

Previously, when performing range_to on colors with hues that crossed 1.0, the color_scale function used in range_to would go through all intervening hues instead of crossing 1.0. For example, when going from purple with hue 0.94 to red with hue 0.04, range_to returned almost all colors (blue, green, yellow) by ranging from 0.94 downward to 0.04 instead of going from 0.94 to 1.0 and then restarting at 0.0 and going to 0.4. This commit fixes that.

@codecov
Copy link

codecov bot commented Mar 26, 2019

Codecov Report

Merging #48 into master will decrease coverage by 2.32%.
The diff coverage is 88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #48      +/-   ##
==========================================
- Coverage   99.13%   96.81%   -2.33%     
==========================================
  Files           1        1              
  Lines         232      251      +19     
==========================================
+ Hits          230      243      +13     
- Misses          2        8       +6
Impacted Files Coverage Δ
colour.py 96.81% <88%> (-2.33%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 11f138e...8a6a0cb. Read the comment docs.

Copy link

@vokimon vokimon left a comment

Choose a reason for hiding this comment

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

Shouldn''t be simpler, in case we detect abs(huea-hueb)>0.5, just adding 1 to the lesser hue and modding resulting hues by one?

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.

2 participants